javascript - Create a range or html fragment in IE from a string -


How can I get a string and with this I can make an html piece in IE. It works fine in non-browsers

  var str = "& lt; div> Foo "; Var range = document.createRange (); Var frag = range.createContextualFragment (str); Var e = document.getElementById ("element"); E.appendChild (frag);  

Would you like to consider using jQuery? Cross-browser compatible and easier to use:

  $ (document) .ready (function () {var str = "& lt; div> Foo  

and


Comments

Popular posts from this blog

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

.net - Self Tracking Entities (STE)'s and partial updates with EF4 and mVC2 -