I encountering some strange inconsistencies between Firefox and IE in regards
to the .html() method.  In Firefox everything's working fine - but in IE,
the previous html gets returned.  An example would explain the problem best:

I have html like this:

<div id="editTogle"></div>
<div id="viewToggle"><span id="aboutYou">text to change here</span> |  #
edit </div>

I use the outer div to hide everything in it, and the inner span to change
only the text within it.  So, my script looks like this:

//hide view div and show edit div
$("#viewToggle").css({display:"none"});  //using css for safari
$("#editToggle").css({display:""});

//I use ajax to get a new string here

//then, I replace the span with the next string
$("#aboutYou").empty().html(newString);
//doing an alert here shows that the text change successfully
alert($("#aboutYou").html());   //good!

//show the view div and hide the edit div
$("#viewToggle").css({display:""});
$("#editToggle").empty().css({display:"none"});

//doing an alert here shows that the text was changed back to the previous
text
alert($("#aboutYou").html());   //bad!


Again, this is working fine in Firefox, but not in IE - so I can't help but
thinking I'm missing something simple.  Any thoughts?

Thanks,
Chad
-- 
View this message in context: 
http://www.nabble.com/html%28%29-returns-different-val-in-Firefox-and-IE--tf2740686.html#a7646807
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to