tags:

views:

40

answers:

2

Hi,

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

A: 

Try something like this:

<div id="foo"></div>

And your js:

$("#foo").load("http://someurl");
Peter Loron
I tried the `$("#foo").load("http://someurl");`. It does not work. It works if I specify an internal html page within my directory
zfranciscus
+1  A: 

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

Simon Hartley
I found a good jQuery plugin called Fancy Box (http://fancybox.net/) to load website within iFrame. It is very to use.
zfranciscus