when boredom strikes the only answer is FSCodes
HomeCalendarPortalGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share | 

 Compiling Javascript in One file

Go down 

Number of posts : 112
Age : 23
Location : cavite
Registration date : 2009-02-22

PostSubject: Compiling Javascript in One file   Wed Mar 25, 2009 2:55 am

Here's a script to load multiple js files. so you can have separate js files for specific scripts.i suggest you place the most important script as the very 1st one. if you have multiple functions in one js file, one error may prevent the function below it from functioning unless the call function is done before the error. example: if function AAAA() has an error, it may prevent BBBB() and CCCC() from executing even if they are independent functions.


1.Create a subfolder & name it as whatever you want to name it.

2.Inside your script folder, save any js you want in each file

1)if you want your who right clicked cbox, save it as wrccbox.js

2)if you want friend randomizer save it also as one file as frbox.js

3)if you want wvm cbox mode, save it also as one file as wvmcbox.js So the above examples will be the contents of your scriptfolder. To apply it in the script it will then look like this:

scriptFolder = 'http://h1.badwaresite.www/username/javascripts/' scripts = new Array() scripts[0] = 'wrccbox.js' scripts[1] = 'frbox.js' scripts[2] = 'wvmcbox.js' for(x in scripts){ myscripts = document.createElement('script') myscripts.src = scriptFolder+scripts[x] document.getElementsByTagName('head')[0].appendChild(myscripts)}

3.Save as whatever you want to name it.This will then your main js file which you need to add in your linker to paste in your profile.

CREDITS: yoshi
Back to top Go down
View user profile http://www.amick17.wordpress.com

Number of posts : 23
Age : 22
Location : i 4got to write smthn' eer eh hahah lolZ:))
Registration date : 2009-05-25

PostSubject: Re: Compiling Javascript in One file   Mon May 25, 2009 12:40 pm

Back to top Go down
View user profile http://www.friendster.com/39089818
Compiling Javascript in One file
Back to top 
Page 1 of 1
 Similar topics
» how to get data dynamically from Notepad file
» Write the variable into a text file.
» Test javascript Calendar
» Help required with JavaScript and Selenese Parameter
» Where do you save javascript

Permissions in this forum:You cannot reply to topics in this forum
FriendsterCodes :: FSC Design & Development :: Javascript-
Jump to: