javascript - Document.write brokes page -
i've prepared view loads aync view , replace current document.write (yes, want replace whole page!):
$.ajax({ type: "get", url: myurl, data: null, async: true, success: function (result) { document.close(); document.open(); document.write(result); document.close(); }, error: function (req, status, error) { $("#loading-div").html("error"); } });
the content full view own scripts , css styles. when using ie or chrome works fine. when load page within firefox, loaded page via document.write doesn't seems working - scripts (some works, don't).
i can't use innerhtml due scripts not evaluated.
why doesn't work in firefox (even ie can handle it!)?
the specification requires document.open
create new global. firefox that. chrome not; can't speak ie.
so if you're depending on old global sticking around, script work in chrome not firefox.
Comments
Post a Comment