Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same issue regarding the best place to add jQuery: to the header or before the body tag? The answer is that it does not matter. </p> <p>The whole page (or DOM) needs to initialize or load in order to accomplish what you are doing. AND.. The more information within the body the more reliance you need to make sure the document is loaded.</p> <p>The 2 sentences above are redundant because:</p> <p>All jQuery ui/basic syntax/widgets, etc are triggered with: <code>$(document).ready( function() { $("#some_id").click( function { MORE CODE HERE }); });</code></p> <p>The code above means that the the full html page (or 'document') needs to be loaded before jQuery can run, aka initialized. </p> <p>There is an order that jQuery needs to be loaded for a ui to work. The actual library needs to be first, then the ui. The library can be downloaded from jquery.com and uploaded to the designers web space or through a CDN (CONTENT DISPLAY NETWORK) to save on bandwidth. Here is an example of how the order should be:</p> <p><code>&lt;script src="http://code.jquery.com/jquery-1.6.4.min.js" &gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js" &gt;&lt;/script&gt;</code></p> <p>Notice the library is the first line, then the UI, in this case I loaded jquery mobile.</p> <p>In con conclusion it does not matter, a preference mostly. More here <a href="https://forum.jquery.com/topic/unclear-where-document-ready-goes#14737000004139019" rel="nofollow">https://forum.jquery.com/topic/unclear-where-document-ready-goes#14737000004139019</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload