Firstly, is there a way to use document.write()
inside of JQuery's $(document).ready()
method? If there is, please clue me in because that will resolve my issue.
Otherwise, I have someone's code that I'm supposed to make work with mine. The catch is that I am not allowed to alter his code in any way. The part that doesn't work looks something like this:
document.write('<script src="http://myurl.com/page.aspx?id=1"></script>');
The script tag is referencing an aspx page that does a series of tests and then spits out something like so:
document.write('<img src="/image/1.jpg" alt="Second image for id 1">')
The scripts are just examples of what is actually going on. The problem here is that I've got a document.write()
in the initial script and a document.write()
in the script that get's appended to the first script and I've got to somehow make this work within JQuery's $(document).ready()
function, without changing his code.
I have no idea what to do. Help?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…