Is it possible to convert a string into a variable name while in jQuery's document.ready?
If I try this in pure JS
var boh = "blahblah";
console.log(window["boh"]);
returns blahblah, while if I go with JQuery
$(document).ready( function() {
var boh = "blahblah";
console.log(window["boh"]);
});
returns undefined
document.ready, but i was curious whether it's possible to get them from inside.bohis in the global scope, which you should avoid by all means while in the secondbohis not in the global scope. Within DOM ready you may replacevar bohwithwindow.bohbut I see no point in cluttering the global scope. Why do you want to use global variables?