hi,
i have added custom jQuery to my site. i have created a new file "init.js" and decleared it in the theme info file properly (in the end). i have the document ready function in the init.js file. Its working properly as I checked the source of my pages. Its getting loaded after all the scripts declared in the theme .info file.
However, sometimes the init.js file is not getting executed (its functions are not working). But, when i am giving the same statements in the fireBug console, its working fine.
I have faced the same problem before also. but i neglected. Now i think i should discuss this matter.
To use the jQuery tools (http://flowplayer.org/tools/demos/index.html), i had to upgrade the jQuery Version, so i replaced the jQuery file from misc folder of the installation.. things are working after the upgrade. Is there anything else i have to do for the upgrade? i tried the module jquery_update, but not-satisfied.
thanks
Comments
You can not manually update
You can not manually update jQuery, existing scripts will break and cause problems. You need to use jQuery Update if you want to use a newer version of jQuery than what comes with Drupal 6.x.
thanks
Allright. I am not updating the jQuery version.
But STILL, sometimes the init.js file is not getting executed (its functions are not working). But, when i am giving the same statements in the fireBug console, its working fine.
One doubt for you nevets, few days back you gave me a solution at http://drupal.org/node/756860 and again http://drupal.org/node/760522, both are doing the same job. I HAVE TO place the reference node ID in the URL alias for the themekey module.
So, can i use only the second/short solution to get arguments for my views block and delete the code of menu_get_object() ??
thnaks
Two things 1) What does your
Two things
1) What does your init.js file look like
2) Two different problems, if the reference node id is in the path the sort solution or variation will work. If a path alias, that is a different matter.
1) Right now my init.js
1) Right now my init.js file
I have roles editor, moderator, anonymous and authenticated. the init.js is executing in all these cases. BUT, when i am logging as user1, its not executing. when i am executing the same statements from FireBug console, its working.
2) Ya i checked the views arguments once again.. You are right. its so confusing...
One more doubt :-)
At the starting of my project, it was simple, and i wrote every steps in my note-book. But now, it has become very complex and very tough to maintain everything as i am doing it alone. is there any solution for this? to keep everything neat and clean.. easy to understand.
Like, yesterday, i broke the installation by enabling-disabling the jquery_update multiple times (and did other useless stuff).
And again i have started the whole thing from begining (this is my 9th time!).. I am doing regular backup, but not mentally satisfied..
Where/how are you including
Where/how are you including the script that provides corner() and uncorner()?
Reasons that come to mind why you are having problems
1) Javascript error, if you use Firefox and the firebug extension this will be obvious (may be obvious for other setups)
2) The corner()/uncorner() functions are unavailable when needed.
3) init.js is not be executed for some reason.
I would use firebug to place a breakpoint on
$("#block-nice_menus-4 ul li a").corner();to see if its even being reached.$(document).ready
hi! I think the problem in drupal 6 you are experiencing is
that you should enclose your $(document).ready in
Drupal.behaviors.module_name = function(context) {
$(document).ready(
//your scripts
);
};
replace the module_name with the name of your module
It worked!!I was testing an
It worked!!
I was testing an example from Drupal 6 Javascript and jQuery, and couldn't get it to work until I followed salexch's hint.
Thanks so much!!