I'm attempting to load content from another page using jQuery .post(), to parse the returned html to pull out only the pieces that I want.
The problem is that, while this works in Firefox et al, it does not work in IE.
I've tracked down the problem to the find() function. Both IE and FF successfully load the html from the other page (which is stored in that "data" object) using post. However, while the line
debugText += jq(data).find('#timeline_events').html();
produces output in Firefox, it produces null in IE.
I've done extensive research, and as far as I can tell, it might either be because of jquery conflicts, or because the page it's loading is xhtml.
In the first case, it's for that reason that I use var jq=jQuery.noConflict(), and use "jq" instead of "$" with all jquery calls. In the second case, I've tried declaring the post return data type explicitly to both html and xml, with no change in result.
Any ideas?
<script type="text/javascript" charset="utf-8">
var jq=jQuery.noConflict();
var debugText = "";
function loadNext()
{
jq.post("test.html", function(data)
{
debugText += jq(data).find('#myEvents').html();
}
}
</script>
Update: Here is a sample of some html from the test page that I want to load onto the current page:
<table id="myEvents">
<tbody>
<tr>
<td>Test</td>
</tr>
</tbody>
</table>
What I'll eventually want to do is pull out the td elements from that table and insert them into another table on my current page.
-Update- jQuery version I'm using: 1.2.3
Loading the data into a hidden object in the document, and then using jquery to select the necessary id element produces the same result - that is, null in IE, and works otherwise.