HomeHome  portal1portal1  GalleryGallery  SearchSearch  Link Rotation  Donate  RegisterRegister  Log inLog in  

Global Announcement

FriendsterAddictz Forum is on-search for Moderators. For more information, click THIS.
Please promote FriendsterAddictz Forum.

ways to combine ur css and js fiLe - switpotato

View previous topicView next topicGo down
Author Message

Age : 24 Registration date : 2008-03-07 Number of posts : 1081 Location : ...somewhere there...
Character sheet
Tagline: Proud Member

PostSubject: 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


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]

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...



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
myscripts[3] = 'extra.js'

if u got none or juz one js remove the excess or better yet just leave the js part blank
myscripts[2] = ' '


tricks number 3: multiple css


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]

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]

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..

creativity is art.
my friendster profile [i][url]http://www.friendster.com/joychristian
Back to topGo down
View user profile
Senior Member
Senior Member

Age : 22 Registration date : 2008-04-28 Number of posts : 268 Location : Philippines
Character sheet
Tagline: Proud Member

PostSubject: Re: ways to combine ur css and js fiLe - switpotato Fri May 09, 2008 11:38 am

tnx 4 sharin
Back to topGo down
View user profile

ways to combine ur css and js fiLe - switpotato

View previous topicView next topicBack to top
Page 1 of 1

Permissions in this forum: You cannot reply to topics in this forum
FriendsterAddictz :: FRIENDSTER SECTION :: Friendster Codes and Tutorials -