I’m trying to match a certain script with the currently loaded scripts on the page:
if($('script[src="' + sn + '"]').length == 0)
$('head').append('<scr' + 'ipt src="' + sn +'"></scr' + 'ipt>');
This works but only for scripts that were loaded normally.
For scripts that were injected using javascript, like the one in my condition, it doesn’t work 🙁
Apparently scripts that are loaded this way are somehow invisible in the DOM, even though they run.
1 Answer