ajax - Dynamic Elements are not appearing in IE8 until there is a mouse click -


I have an Ajax request that returns returns to search results, and I dynamically I am creating DOM elements. It is working as expected in all browsers other than IE8.

The request is returning correctly, javascript is running successfully, and elements are created, but the elements are not displayed in the page, they appear only after a mouse-click on the page.

I did a quick test which ran a callback code without the Ajax request, so I'm thinking that the way IE8 is managing the callback thread, there is something like that with it. Has anyone seen such behavior, or has information about it?

Callback is basically very simple. I've re-submitted it with:

  function catches result (response) {var contentBlock = document.getElementById ('divResults' ); Var divResults = document.createElement ('div'); Var txt = document.createTextNode ("Result"); DivResults.appendChild (txt); ContentBlock.appendChild (divResults); }  

I'm using JQuery.ajax to call. I have seen fair behaviors in Firefox and Chrome

Thanks for the help!

I did not come to this problem on IE8 so long ago.

I think this question can not be a problem in IE8, which does not re-interpret the elements in the questions. One easy way to confirm this is by adding a class to parent element and then removing it.

Javascript version:

If the content is the basic element, then you can test it with:

Javascript version:

  // Variable test class name var testClass = "testclass"; // Add test class for content. Block.className + = "" + testclass; // Remove Registry Exam from Element reg = New RegExp ('(\\ s | ^)' + testclass + '(\\ s | $)'); ContentBlock.className = contentBlock.className.replace (reg, '');  

jQuery version:

  // variable test class name var testClass = "testclass"; Add the test class to the // element and then remove it $ ('# divResults'). AddClass (testclass) .removeClass (testclass);  

Add child by putting it at the end of the function and hopefully this should fix your problem.

Reference:


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -