[jQuery] Access remote page using jQuery.ajax
According to the API documentation of jQuery, the jQuery.ajax function
is supposed to: "Load a remote page using an HTTP request." I've tried
running a function with jQuery.ajax:
var xmlDocument = 'dev.xml';
$.ajax({
type: "POST",
url: "http://example.com:80/xmlservlet",
processData: false,
data: xmlDocument,
success: function(msg){
alert( "Data Saved: ");
}
and I keep getting an error "Access to restricted URI denied" code:
"1012" when I run this with Firebug. Googling this error reveals that
it may be an issue with cross-domain AJAX requests. Further research
indicates it may be a Firefox security issue, since I am running it
from my localhost.http://jquery-howto.blogspot.com/2008/12/access-to-
restricted-uri-denied-code.html. This article says to fix it, you
should run it from an internal webserver, which is what I already have
setup from localhost with IIS, PHP, etc.
I tried to run this in IE7 too, but didn't get the desired "Data
Saved" alert, and I don't know of a way to debug javascript in IE.