FriendsterCodes
Would you like to react to this message? Create an account in a few clicks or log in to continue.


when boredom strikes the only answer is FSCodes
 
HomePortalGallerySearchLatest imagesRegisterLog in

 

 Compiling Javascript in One file

Go down 
2 posters
AuthorMessage
Amick
Admin
Admin
Amick


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

Compiling Javascript in One file Empty
PostSubject: Compiling Javascript in One file   Compiling Javascript in One file EmptyWed 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.


INSTRUCTIONS

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:

Code:
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
http://www.amick17.wordpress.com
jee:)jee:)
Newbie
Newbie
jee:)jee:)


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

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

tnx!!!!!
Back to top Go down
http://www.friendster.com/39089818
 
Compiling Javascript in One file
Back to top 
Page 1 of 1
 Similar topics
-
» Rules In Javascript

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