2

I'm trying to post login and password to the other website through jquery I tried all ways,jquery post,jquery get and the old method whith using XMLHttpRequest but nothing worked ! Every time when I tried to read(I mean to get or to post) from the other websites I was getting error in firebug

Connection close Content-Type text/html; charset=UTF-8 Date Mon, 11 Feb 2013 22:20:29 GMT Server Apache Transfer-Encoding chunked X-Powered-By PHP/5.3.3

but when I tried to read from the pages on my server I could get the html of them. the problem appeared while using website url to get the file. Who know how to solve such kind of problem,please help

Edwin Alex
  • 5,118
  • 4
  • 28
  • 50
  • http://enable-cors.org/ – Atif Feb 12 '13 at 11:13
  • 1
    [Same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy) – Chris Feb 12 '13 at 11:13
  • 1
    Is the website hosted on the same domain as the page you issue the ajax call from? If not, you might want to check on 'cross-domain policy' – etienne Feb 12 '13 at 11:14
  • 1
    Questions you should read: http://stackoverflow.com/q/3076414/218196, http://stackoverflow.com/q/2558977/218196, http://stackoverflow.com/q/298745/218196, – Felix Kling Feb 12 '13 at 11:16

1 Answers1

1

You must be aware that ajax calls to other domains is restricted by most of the browsers. Others, in order to do such due to some other valid reason of doing so, uses third party js libs to execute this CROSS-DOMAIN requests / calls.

Aldee
  • 4,439
  • 10
  • 48
  • 71