0

I am using $.getscript(""); to get remote script. However, when I use it, the referer information goes to there. I don't want to send the referer information when I use the function. Tried this without any luck,

$.ajaxSetup({
    headers: { "Referer": "" }
});

$.getScript("http://www.example.org/script.js");

What is the correct way to do that ?

user198989
  • 4,574
  • 19
  • 66
  • 95

2 Answers2

1

The browser will overwrite the referrer always for the tests that I've done. Meaning you can't change the referrer of an ajax call.

Since getscript() is documented as being shorthand for an ajax call, this also applied to getscript().

See:

changing the referrer of an Ajax POST

http://api.jquery.com/jquery.getscript/

Community
  • 1
  • 1
Kolban
  • 13,794
  • 3
  • 38
  • 60
1

If you're sending a request from a non-secure source to a secure source (http to https) the browser should not send the referer with the request. That is only a workaround though and it depends how well the browser follows through with web standards.

Jonathan Gray
  • 2,509
  • 15
  • 20