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 re
picardo has the approach I would've used. To expand on the concept, take a read:
$('')
.attr('src', 'http://myurl.com/page.aspx?id=1')
.appendTo('body');
Alternate style:
var imgnode = $('')
.attr('src', "image1.jpg");
$('#id1').append(imgnode);
Be sure to use the attr
method to set any dynamic attributes. No need to escape special symbols that way.
Also, I'm not sure what the effectiveness of dynamically generating script tags; I never tried it. Though, it's expected that they contain or reference client-side script. My assumption is that what page.aspx
will return. Your question is a little vague about what you're trying to do there.