0

See this question first, and the top answer. That being said, I need to issue an XMLHttpRequest to a remote server from a mobile app. Can someone show an example? I can't figure out where to specify the URL (with parameters) as shown in the answer to the previous question.

Community
  • 1
  • 1
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
  • WAIT: the open method on the XHR object has parameters open(method,url,async)......if I put a full URL in the URL, is that all that's needed? I always interpreted that as just taking the location of the file on the server, assuming the page were querying its own server rather than a 3rd party server. – temporary_user_name Apr 21 '12 at 00:04

1 Answers1

1

XMLHttpRequests takes a URL as a parameter. It can be a relative URL, but it can also be a fully qualified URL...except that it probably won't do what you want, due to cross-site scripting protections built into most browsers.

This question has details on solutions to this issue.

Community
  • 1
  • 1
larsks
  • 277,717
  • 41
  • 399
  • 399