How to use document.write with jQuery Mobile

How to use document.write with jQuery Mobile

I'm building a mobile site using jQuery Mobile, and I need to include widgets that use document.write. When I test embedding the widget code in a page using a collapsible content block, the widgets overwrite the entire page. I'm aware that any document.write that doesn't fire inline (after the doc is done loading) actually calls window.open, which I assume is where the issue is coming from. Here's a sample of the widget code:

<script>
var x = someDate;
var y = someOtherDateVar;
document.write(<script src="http://web-service-url.php"></script>);
</script>

Does script injection like this work with jQuery Mobile? Or with core jQuery?