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 updateList is defined like so;
function updateList(data)
{
if (data)
{
$('#contentlist').html(data);
}
else
{
$('#contentlist').html('<li><a href="#" id="synclink">Nothing found. Try again</a></li>');
}
}
The function runs, and updateList
is called. It works fine in IE. However, in Firefox, the data
parameter is always empty. I would expect it to be filled with the content of the webpage I passed in as the URL. Am I using it wrong?
Notes;
- in Firebug, I've enabled the Net panel, and I get the request showing up. I get a
200 OK
. TheHeaders
tab looks fine, while theResponse
andHtml
panels are both empty. - The page I'm trying to download is a straight html page -- there's no problem with server code.
- The page with Javascript is local to my machine; the page I'm downloading is hosted on the net.
- I've tried checking the url by copy-pasting it from my page into the browser -- it happily returns content.
- The error occurs even in Firefox Safe Mode -- hopefully that rules out rogue addins.