FriendsterAddictz
Administrator
Age : 30
Registration date : 2008-03-07
Number of posts : 1081
Location : ...somewhere there...
Character sheet Tagline: Proud Member
|
Subject: ways to combine ur css and js fiLe - switpotato Sat Apr 26, 2008 11:54 am |
|
|
Note: Permission to repost was GRANTED by the author
tricks number 1: multiple ONLOAD FUNCTION
this is the oldest compiling tricks made by Archer this will guarantee to resolve ONLOAD CONFLICT
- Code:
-
var css = document.createElement("link"); css.type = "text/css"; css.rel = "stylesheet";css.href = "complete css url here"; css.media = "screen, print";document.getElementsByTagName("head")[0].appendChild(css);
scriptFolder = 'ROOT FOLDER URL HERE' scripts = new Array() scripts[0] = 'loader.js' scripts[1] = 'tracker.js' scripts[2] = 'scrollsubnav.js' scripts[3] = 'scrollphoto.js' scripts[4] = 'reposition.js' scripts[5] = 'addbox.js'
for(x in scripts){ myscripts = document.createElement('script') myscripts.src = scriptFolder+scripts[x] document.getElementsByTagName('head')[0].appendChild(myscripts)} if u guys are using the oldest loader script (IE) made by archer like the one i posted here in other topic no need to use CSS inject...
eg: page with dual onload codes... again my sample is using IE loader Script...
http://profiles.friendster.com/64508247
====================
tricks number 1: multiple css
author: ARCHER
save ur work as .txt/ .js/.swf/ etc dpendin to wat linker u wil use rootFolder = name of main folder wher u upload ur css and js pls use one folder name for all of ur files
css and js part= name of ur file ... u dont need to put the complete url
if u need more slot for js just add eg: myscripts[3] = 'extra.js'
if u got none or juz one js remove the excess or better yet just leave the js part blank eg: myscripts[2] = ' '
====================
tricks number 3: multiple css
- Code:
-
rootFolder ='fileLibrary/'
var myscripts = new Array() myscripts[0] = 'file1.js' myscripts[1] = 'file2.js' myscripts[2] = 'file3.js' myscripts[3] = 'file4.js' myscripts[4] = 'file5.js'
for(x in myscripts){ scriptFile = document.createElement('script') scriptFile.src= rootFolder+myscripts[x] document.getElementsByTagName('head')[0].appendChild(scriptFile) }
var mycss = new Array() mycss[0] = 'mycss1.css' mycss[2] = 'mycss2.css' mycss[3] = 'mycss3.css'
for(x in mycss){ cssFile = document.createElement('link') cssFile.rel = 'stylesheet' cssFile.href = rootFolder+mycss[x] document.getElementsByTagName('head')[0].appendChild(cssFile) }
same explanation as mentioned above
arrange the myscript according to ur liking .. decide w/c script u want to load first. and insert it into [0] ....
============
tricks number 4... author angell
save this as txt or swf and use the linker.. as final step.. |
|
jObeLLe
Senior Member
Age : 28
Registration date : 2008-04-28
Number of posts : 268
Location : Philippines
Character sheet Tagline: Proud Member
|
Subject: Re: ways to combine ur css and js fiLe - switpotato Fri May 09, 2008 11:38 am |
|
|
tnx 4 sharin |
|