add_js

add_js

ClipBucket has a very useful function that is used to add Js file in ClipBucjet template so that you dont need to add js file in each template seperately, all you have to do is to add a little code and your file will be included in all templates

usage

add_js(array[]);

explanation

array(“file”=>”scope”);

file

Make sure your file is placed in /js directory, e.g if you want to call my.js , you first place it in /js directory and then add array(“my.js”=>”watch_video”); , similarly if your file in /js/somefolder/myfile.js , you will add it array(“somefolder/myfile.js”=>”watch_video”);

scope

scope basically tells the clipbucket in which files we should include this file , ie , watch_video, home, view_channel etc… or say for each file_name.php scope name is file_name. ok , if you add

array(“my.js”=>”watch_video”); array(“my.js”=>”view_channel”); array(“my.js”=>”view_group”);

it will include my.js file in all these “watch_video” , “view_channel” and “view_group” files.. if you want to add my.js in all files, simply, call function as follow

array(“my.js”=>”global”);

Last updated