javascript - Drupal 6 Drupal_add_js -


i realized need add javascript drupal block module front page. found out reason when add:

drupal_add_js(drupal_get_path('module', 'slider') .'/slider.js'); 

to case "view" in slider_block function, webpages except front page module used on, @ .js , run instead of loading normal page.

the slider.js is:

drupal.behaviors.slider = function(context) {      var x     x = 50;     document.write (x); //prints value of x } 


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -