Crystal,
If using the built in jQuery CDN, I found it very useful to create a jscript_*****.php file, this file loads after the call to the jQuery CDN
In that file is where I call any *****.js files which load after the call to the jQuery CDN
This is also a great way to call page specific *****.js files using PHP
(EXAMPLE)
Code:
<?php if (in_array($current_page_base,explode(",",'advanced_search_result')) or $current_page_base == 'index' and $cPath != '' or $current_page_base == 'index' and $_GET['manufacturers_id'] != '') { ?>
<script type="text/javascript" src="includes/templates/responsive_template_default/jscript/*****.js"></script>
<script type="text/javascript"><!--//
$(function() {
$(document).ready(function() {
YOUR CODE
});
}) (jQuery);
//--></script>
<?php } ?>
The above *****.js file and code only loads on the advanced_search_result page, all index pages where a cPath is passed or index page where a manufacturers_id is passed
or you can just call your *****.js file and code
(EXAMPLE)
Code:
<script type="text/javascript" src="includes/templates/responsive_template_default/jscript/*****.js"></script>
<script type="text/javascript"><!--//
$(function() {
$(document).ready(function() {
YOUR CODE
});
}) (jQuery);
//--></script>
I am still not sure why it was done this way where the built in jQuery CDN call loads after all site-wide jscript_*****.js files located within the custom templates folder but it can be used in a positive way.
You can also embed into html_header.php
just MO
Originally Posted by
DivaVocals
You are misunderstanding the question..
jQuery plugin = "'JQuery plugin' you are referring to any code (or module) that makes use of the JQuery function calls"
I know how jQuery plugins work.. (there are a ton of modules here which use jQuery plugins including Zen Colorbox, etc) I know that jQuery must be loaded 1st for my jQuery plugin to work.. However in the new v1.5.4 world, loading a jQuery plugin via the normal upload your jscript_[yourfilenamehere].js file to the jscript folder will mean that the plugin WILL load before jQuery does (see Raymonds initial post here).. I need this plugin to work sitewide. So a page specific javascript file will not work unless I add it to EVERY page folder..
So I want to know if hard coding the link to my jQuery plugin into the html_header.php is the ONLY way to make sure my plugin loads AFTER jQuery (AKA will load sitewide)
Bookmarks