Can You Write JQuery Code Inline Before Loading JQuery?
I wouldn't think its possible at all, but I'm just wondering because my friend has this on his page:
function $(){
// do stuff
}
would do the exact same thing. Having those definitions in an external file would not make them callable before they were loaded.
Tangental note: It is not strictly impossible to write code that eventually will use jQuery before jQuery has loaded, but you would be putting your code in something that would be called only once jQuery has loaded. I'm not aware of any jQuery convention of doing this, as it's not very common to do that with this library, but Facebook does it like this: https://developers.facebook.com/docs/reference/javascript/ I don't think your friend should actually attempt this until he is more familiar with JavaScript.
Post a Comment for "Can You Write JQuery Code Inline Before Loading JQuery?"