cotonti.com : Load Chili files on demand https://www.cotonti.com Laatste forum onderwerpen Cotonti en Thu, 01 Jan 2026 03:13:51 -0000 Orkan
$.plugin.register("jquery.chili", {fn: "chili"});
when you call $.chili() somewhere on the page, it will load jquery.chili.js file first and then proceed with chili() as usual. Very smart :)

Additionally, you can use two callbacks, onBefore and onAfter, for example to load additional files like style sheets, etc...

see chili.header.php in my rar for more info...]]>
Wo, 17 Sep 2008 04:24:33 -0000
Trustmaster Wo, 17 Sep 2008 00:45:32 -0000 Orkan Im back with an incredible solution how to load not only Chili but all jQuery plugins on demand. This is the plugin Im referring to: http://plugins.jquery.com/project/Plugin

I've made some tests with Chili and it works like a dream!
Heres the test page you can check out:
6-jquery_lazy_load.rar
(http://www.cotonti.com/datas/users/6-jquery_lazy_load.rar)

LOL, whats wrong with this bbcode parser?
http://www.cotonti.com/datas/users/6-jquery_lazy_load.rar

Also I've made a decision to change the directory structure a bit for javascript files.
You can see my idea in rar file.

mainly "dev" folder is for uncompressed javascript files - good for debugging or svn diff
and "prod" is for production

This should go to header.tpl
<script type="text/javascript">
var jQueryBase = location.host.match(/localhost/i) ? "./javascript/jquery/dev/" : "./javascript/jquery/prod/";
document.write(unescape("%3Cscript type='text/javascript' src='https://www.cotonti.com/" + jQueryBase + "jquery.js'%3E%3C/script%3E"));
document.write(unescape("%3Cscript type='text/javascript' src='https://www.cotonti.com/" + jQueryBase + "jquery.plugin.js'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
$.plugin.defaults.base = jQueryBase;
$.plugin.defaults.ext = ".js";
</script>

PS. use "view plain" button to see the correct code, because something wrong with Chili here (repeated lines 3 & 4)
Again problem in html.js - with recipes.js everything works as expected.]]>
Di, 16 Sep 2008 19:26:41 -0000
Trustmaster
We will return to this problem after we find the best way to control header part from the body code (like plugins).]]>
Wo, 03 Sep 2008 23:21:45 -0000
Kilandor Wo, 03 Sep 2008 23:20:04 -0000 Orkan We could load them on demand in footer hook.
All we need to know, is an information that [ highlight] bbcode has been parsed at least once...

Is this possible to retrieve such information from Cotonti parser?]]>
Wo, 03 Sep 2008 23:04:07 -0000