try to use next code:
var main_url = "http://www.example1.com";var referrer = "http://www.example2.com";$.ajax({ url: main_url, dataType: "json", headers: {'X-Alt-Referer': referrer }, success: function(data){ console.log(data); }});