I need to be able to use jQuery's load function to grab the contents of an external file and append them to a particular DOM element. The problem is that when that external file includes scripts that contain calls to document.write, I get weird behavior that changes depending on which browser I'm using.
If I'm using Internet Explorer, the load function gets all of the non- script elements from the external page and correctly appends them into the DOM element. Of course, this is not ideal because it ignores the scripts. If I'm using Firefox or Safari, the load function runs the scripts but the document.write output overrides the entirety of the calling page. Thus, I end up with a page that now only contains the document.write output instead of a page that includes the original HTML plus the document.write output as a child of a DOM element. I don't think this is a jQuery issue but I experienced it while running jQuery so I posted here in the hopes that someone else has experienced this and knows a workaround. :-)