4 ms·
Rather than using the roundabout technique of writing another tag This isn't so roundabout: var path = 'http://www.domain.com/script.js'; $('#code').html(
by byoung2 16y ago
Rather than using the roundabout technique of writing another tag
This isn't so roundabout:
var path = 'http://www.domain.com/script.js';
$('#code').html('<script type="text/javascript" src="'+path+'">');
jQuery loads the script, evaluates it, then discards it.
- NathanKP 16y agoTo me it seems a little bit more obscure than just loading the JavaScript and the performing an eval() on it. My other problem is that it discards the script. If you replace the contents of #code, perhaps by loading another script it would also delete the existing script, right?