1

i try using jquery ajax to get content from :

http://www.infovesta.com/isd/free/reksa2.jsp?tipe=pt&_=1332749661789

that url is contained data from h**p://www.infovesta.com/isd/index.jsp

after checking by firebug on my working page, i get http response 200 but data is not loaded,
but comparing to their site, they can get the data with that request url.

what's the step i missed?

my code :

<script> $(document).ready(function(){ $.ajax({ url: 'http://www.infovesta.com/isd/free/reksa2.jsp?tipe=pt&_=1332749661789', success: function(data) { $('.result').html(data); } }); }); </script> 
3
  • By the looks of it, they limit the data to their own server (so an external call wont work, like you are trying to do.) try copying the url to the browser and see, you get no data back. so its not your script that does not work. Commented Mar 26, 2012 at 8:38
  • What do you have displayed in response? Commented Mar 26, 2012 at 8:39
  • ya nothing appeared on my browser if i open it directly Commented Mar 26, 2012 at 8:48

1 Answer 1

1

I think that you are calling another domain and you have a problem with same domain policy. Does that site support jsonp?If so you should do

 $.ajax({ url: 'http://www.infovesta.com/isd/free/reksa2.jsp?tipe=pt&_=1332749661789', dataType: 'jsonp', success: function(data) { $('.result').html(data); } }); 

Setting the dataType to jsonp does the following

Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.

Sign up to request clarification or add additional context in comments.

2 Comments

how to know if they provide jsonp?
@kreamik you should either try it or look at the documentation of the site

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.