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 <adrianc.grigo...@gmail.com>
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;">
>                 &nbsp;
>         </div>
>
> </body>
> </html>

Reply via email to