It is a very difficult task to insert a short sentence, so I apologize if I kill him.
I recently launched a site that has been extensively tested on my local web server on all of my required browser platforms, including IE8 (IE8 standards mode, XHTML Strict). I had no problems until the site went to a dedicated web server.
The site uses jQuery.get() in the change event for input form elements, where the response is grafted into a common <div id="results"></div> .
Despite the caching issues that I read about in IE and XMLHTTPRequest, my problem seems to happen AFTER my ajax callback starts execution. My callback (provided via .get() / .load() - I tried both) gets the HTML fragment returned by my server. Testing the returned content in any browser shows exactly what I expect from the content.
However, as soon as I put the HTML fragment in the DOM tree in #results , IE will actually copy the first 7 or 8 opening tags from my markup (along with the children of most of these tags). This is viciously bizarre. I installed it in another area of ββthe site by setting the HTML content via jQuery('#results')[0].innerHTML = content , but this time not a cube.
Answer example:
<div> <a href="#">some link</a> <span>stuff, blah blah</span> <a href="#">another link</a> <ul> <li id="item-2342"> <img src="#" /> <div class="info"> <h6> ..title.. </h6> <a href="#">View</a> <span rel="stats"> ..statistics.. </span> </div> </li> </ul> </div>
Literally EVERYTHING through the opening tag that <span rel="stats"> truncated. The effect is that IE displays my returned AJAX content as if it started with the text node: ..statistics.. </span> . (I tried to remove rel="stats" as suggested below, replacing it with a CSS class, but the same result.)
If I request my AJAX URL directly through the browser URL field, the returned content will be perfect.
If I use alert() to display the returned AJAX content, it is perfect.
If I assign my AJAX content using .html() or .innerHTML , it will be truncated immediately.
Sooo .... WTF? IE debugger (crappy) displays script errors or something like that. Has anyone ever dealt with this issue before? Again, I emphasize that IE has no problems on my development server (127.0.0.1), and it seems to use the same βmodeβ (IE8 standards) and all that.
EDIT: here is the Javascript providing the AJAX search:
jQuery('.ajax-panel').live('load', function(event, request_string){ var panel = jQuery(this).stop(true).fadeTo(100, 0.2).addClass('loading'); var form = jQuery(panel.attr('rel')); jQuery.get(form.attr('action'), request_string ? request_string : form.serialize(), function(response){