Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#5879 closed bug (invalid)

Ajax Cross-Site load for HTML content broken

Reported by: avidmalone Owned by:
Priority: major Milestone: 1.4.1
Component: ajax Version: 1.4
Keywords: Cc:
Blocked by: Blocking:

Description

I'm attempting to use the Ajax load function to load HTML from a different domain. When I attempt to do this, I'm getting the 'Access to restricted URI denied" code: "1012' error message in Firebug. I'm including sample code to demonstrate the issue. I've tried appending ?callback=? to the URL as I've seen suggested, but this doesn't appear to resolve my issue.

<html> <head> <script src="jquery-1.4.min.js"></script> </head> <body> <div id="content"></div>

<script type='text/javascript'>

$(document).ready(function () {

$('#content').load('http://google.com?callback=?');

});

</script> </body> </html>

Please note - I'm not really trying to load Google's home page as my content, I'm just using this as an example, since I can reproduce the problem using Google's home page.

Change History (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: invalid
Status: newclosed

The web browser won't let you request arbitrary content from other domains using xmlhttprequest. The only type of cross-site requests allowed are scripts and jsonp. See the jQuery documentation and/or ask on http://forum.jquery.com for more information.

Note: See TracTickets for help on using tickets.