Loading an website content in a dialog window
I am exploring jQuery.get() ajax call to load a website content into my HTML page. The problem is that I am not too sure whether I am using the command correctly
For example: I 开发者_开发百科would like to load the following website content from google to my HTML page.
I use the following jQuery script to do it :
$.get("http://www.google.com/maps/place?source=uds&q=cafe&cid=10972320184180601304");
Hoping that it will give me back the website content so that I can append it into my HTML page. I cant seem to get any response back from the $.get(...)
.
Am I going to the right direction here or should I be looking for a different approach altogether ?
Cheers
I think that the browser security model prevents you from doing this. The best you'll be able to achieve is having the other page shown in an iframe.
See: http://en.wikipedia.org/wiki/Cross-site_scripting
Try something like this:
<div id="foo"></div>
And your js:
$("#foo").load("http://someurl");
精彩评论