Message from JavaScript discussions

September 2020

β€” Nope, the easiest way is to unblur your mind out of camouflaged content🀀 open source for life

β€” 

My website has a variable in global scope. How do I find out which javascript file has created this variable?

β€” In dev tools you can search all files

β€” Ctrl+shift+f

β€” You can't search for browser defined globals though. But you can find out if it comes from the browser with fn.toString()

Message permanent page

β€” Thanks

β€” I really really really hate Safari

β€” (on iOS)

β€” Does the load event never fire on that or am I stupid?

β€” (or both)

β€” Asked in a different way: Why does this work in every browser except Safari?

var dateien = ['https://www.example.de/_Resources/Static/Packages/Example.Site/news/newsHome.js', 'https://www.example.de/_Resources/Static/Packages/Example.Site/calendar/calendar2M-mapbox.js'];

function jsOnload() {
for (var i in dateien) {
console.log(dateien[i]);
var element = document.createElement("script");
element.src = dateien[i];
document.body.appendChild(element);
}
}
if (window.addEventListener) window.addEventListener("load", jsOnload, false);
else if (window.attachEvent) window.attachEvent("onload", jsOnload);
else window.onload = jsOnload;

Message permanent page

β€” Http://jakearchibald.github.io/request-quest/