by Otto » Sat Dec 28, 2019 1:31 pm
@Otto
The load order of CSS doesn't really matter unless you're doing stuff from Javascript that depends on the styles somehow being present.
the bootstrap JS doesn't need the styles, it's just a complement to them
I don't know about jQuery UI, but I believe it's the same
when I say load order doesn't matter I mean you won't get different results from loading them in a different order
unlike for JS
About wrapping the code:
by default JS code runs where you put the s cript tag
the HTML parser reads the HTML file,
and it it finds a <s cript> tag it'll stop the world and download it (if it has a src attribute) and then run it before moving on to the following HTML
that means that if you have a <s cript> tag in the document's <h ead>, you won't have access to anything in the <b ody>
j Query gives you an easy way to solve this by wrapping all of your code into a function, like this:
j Query(function($) {
// your code here, it can use `$` as the jquery object
});
and the code inside that function expression will be run after the page is completely loaded
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club********************************************************************