0

I am using an ajax code, when I am using a file name under the same domain that was calling and responding, but when I am using url link to call the php file then the file was calling but I got no responce, I have tested it writing a mail function on the php file, the mail is sending but giving no responce

$.get("http://otherserver.com/wp-content/plugins/maya-shop/hello.php",{c_id:5,licence_no:6},function(data,status)
Bidyut
  • 539
  • 2
  • 8
  • 17
  • Your request is being blocked by the Same Origin Policy https://www.google.co.uk/#hl=en&sugexp=les%3B&gs_nf=1&tok=5R2TvdHX3GkRuCMiN1wNbA&cp=7&gs_id=3w&xhr=t&q=same+origin+policy&pf=p&output=search&sclient=psy-ab&oq=same+or&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=ac03864a29a96a7e&biw=1091&bih=514 – Rory McCrossan Sep 17 '12 at 13:29
  • for what reason it may blocked ? – Bidyut Sep 17 '12 at 13:31
  • can you show us the code in hello.php, to check if everything is alright in there? – Teena Thomas Sep 17 '12 at 13:32
  • @Bidyut the request must be calling the same domain it was requested from, unless you specify a JSONP datatype request. The links in the google search I posted have all the details. – Rory McCrossan Sep 17 '12 at 13:34

2 Answers2

1

Ajax is not allowed to call scripts on other domains. Here is another good article on how to overcome the same origin policy: Ways to circumvent the same-origin policy

Community
  • 1
  • 1
w01k3
  • 101
  • 1
  • 5
0

I have find the solve. here need to use .getJSON() for overcome the problem same origin policy; get details in http://api.jquery.com/jQuery.getJSON/

Bidyut
  • 539
  • 2
  • 8
  • 17