By keevitaja on
Hi,
i have a wierd problem. In my theme jquery is working only on the front page. Though all files (jquery, myscript.js etc) are loaded on each nodepage as well. when i put alert('some text') in myscript.js it works. as soon as i try to do it inside jquery, nothing happens:
$(document).ready(function(){
alert('test');
});
Any ideas?
Comments
A link to the site in
A link to the site in question would help.
the problem is with colorbox
the problem is with colorbox module actually. when this module is enabled, jquery is broken. i had it configured that colorbox is disabled on the front page.
colorbox was not working anywhere as far as i can tell. is it possible to fix it?
site is only in my computer so i can not link it!
drupal_add_js function is useful
drupal_add_js function is suitable for your process.
You have to specify your jquery file or file path with corresponding module name inside this function.
Place this function in yourtheme_preprocess_html() in template.php. Because this jquery will execute while loading the pages.
If you want to add js file for specified region then written condtion for the corresponding region.