开发者

jquery.ajax is not working

开发者 https://www.devze.com 2023-03-28 06:56 出处:网络
I trying to get webpage\'s html by using aja开发者_C百科x function like below. But it always alert \'error\'.

I trying to get webpage's html by using aja开发者_C百科x function like below.

But it always alert 'error'.

I can't understand why it occur.

I also checked http protocol status using firebug in firefox.

It show me a 200 value.

Plz let me know how to debug it.

jquery.ajax is not working

     $.ajax({
      url: "http://news.naver.com/main/home.nhn",        

      success: function() { alert('success'); },
      error: function(jqXHR, textStatus, errorThrown) { alert(textStatus); }
    });


Is naver.com your site? If not, then you can't retrieve data from it using AJAX, since you can only make AJAX calls to the same domain as the page you're on.

If that's not the problem, then you'll need to provide more details - like what's inside your arguments in your error function.

0

精彩评论

暂无评论...
验证码 换一张
取 消