jQuery $.get() function succeeds with 200 but returns no content in Firefox

后端 未结 3 820
感情败类
感情败类 2021-01-24 01:58

I\'m writing my first bit of jQuery, and I\'m having a problem with jQuery.get(). I\'m calling this;

$.get(url, updateList);

where

相关标签:
3条回答
  • 2021-01-24 02:12

    You probably won't be able to do this due to cross-domain security. Internet Explorer will allow you to Ajax remote domain when running from file://, but Firefox and Chrome won't.

    Try to put both files on the same server and see if it works (it should).

    0 讨论(0)
  • 2021-01-24 02:22

    You'll most likely need to fix your page that you're quering with XHR because it should be returning content. Copy paste the link in the Firebug net tab and make a new tab, and edit that page with your text editor so it spits content back.

    0 讨论(0)
  • 2021-01-24 02:22

    Stick alert (or breakpoint in Firebug) and see if the data returned is not an object (or if there is any data). If the former - you may need to drill into the object to get your markup

    0 讨论(0)
提交回复
热议问题