The only thing the browsers care about is the domain name
On Mar 19, 10:47 am, Adrian Grigoras <[email protected]> wrote: > If the call in in the same domain, but on another machine, it will > work? > > For example, call example1.mydomain.com from example2.mydomain.com > > Thanks > > On Mar 19, 3:36 pm, MorningZ <[email protected]> wrote: > > > I'm not sure who you are replying to, but regardless, the $.ajax code > > cannot call another domain > > > you'll have to use an <iframe> tag or work out something on your > > server side code to call the remote domain and then call that code > > from your javascript (pretty much using your server/code as a proxy) > > > On Mar 19, 5:46 am, Adrian Grigoras <[email protected]> > > wrote: > > > > I have the same question. I want to load some external file, for > > > example:http://www.google.com. > > > > This is my code: > > > <html> > > > <head> > > > <title>jQuery - Ajax dynamic content loading</title> > > > <script src="http://code.jquery.com/jquery-latest.js" type="text/ > > > javascript"></script> > > > <script type="text/javascript"> > > > function loadContent(id) { > > > $.ajax({ > > > url: "http://www.google.com", > > > cache: false, > > > success: function(html){ > > > $("#contentArea").append(html); > > > }}); > > > > } > > > </script> > > > </head> > > > <body onLoad="loadContent();"> > > > > <div id="contentArea" style="margin: 20px 0px 10px 10px; border: > > > 1px > > > solid #CCC; width: 780px; height: 250px; float: left;"> > > > > > > </div> > > > > </body> > > > </html>

