Unskilled Forum
Welcome to Unskilled! Smile
Please Login/Register To have a full access in our site!

~ Unskilled Team/Staff!

Join the forum, it's quick and easy

Unskilled Forum
Welcome to Unskilled! Smile
Please Login/Register To have a full access in our site!

~ Unskilled Team/Staff!
Unskilled Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

External JavaScript compilation

2 posters

Go down  Message [Page 1 of 1]

crazyadmer

crazyadmer
Administrator
Administrator

Before You can apply all the tricks given here,, be sure that you already know how to compile your JS incloudling your CSS..

If you want to fuction your CSS as JS external follow the given CSS INJECTION codes.

Quote:

// CSS INJECTION
var css = document.createElement("LINK");
css.type = "text/css";
css.rel = "stylesheet";css.href = "URL OF YOUR CSS";
css.media = "screen, print";document.getElementsByTagName("head")[0].appendChild(css);


If you want to insert multiple external JAVASCRIPT follow the given JS INJECTION codes.


Quote:

//JS INJECTION
var scripts = new Array()
scripts[0] = 'URL OF YOUR JS'
scripts[1] = 'URL OF YOUR JS'
scripts[2] = 'URL OF YOUR JS'
for(x in scripts){
myscripts = document.createElement('script')
myscripts.src = scripts[x]
document.getElementsByTagName('head')[0].appendChild(myscripts);
}


as what you've seen, you can insert multiple JS as many as you can..

so this is now your MAIN EXTERNAL JS
Quote:

// CSS INJECTION
var css = document.createElement("LINK");
css.type = "text/css";
css.rel = "stylesheet";css.href = "URL OF YOUR CSS";
css.media = "screen, print";document.getElementsByTagName("head")[0].appendChild(css);

//JS INJECTION
var scripts = new Array()
scripts[0] = 'URL OF YOUR JS'
scripts[1] = 'URL OF YOUR JS'
scripts[2] = 'URL OF YOUR JS'
for(x in scripts){
myscripts = document.createElement('script')
myscripts.src = scripts[x]
document.getElementsByTagName('head')[0].appendChild(myscripts);
}


save as MAIN.JS


You can also base the given example below:

mymainscript.js
Quote:

// CSS INJECTION
var css = document.createElement("LINK");
css.type = "text/css";
css.rel = "stylesheet";css.href = "myBGscript.css";
css.media = "screen, print";document.getElementsByTagName("head")[0].appendChild(css);

//JS INJECTION
var scripts = new Array()
scripts[0] = 'floatingimage.js'
scripts[1] = 'loadingtrick.js'
scripts[2] = 'welcometrick.js'
for(x in scripts){
myscripts = document.createElement('script')
myscripts.src = scripts[x]
document.getElementsByTagName('head')[0].appendChild(myscripts);
}

**YOU CAN ALSO PUT SOME JS CODES BELOW**



RED= url of your JS
CYAN= url of your CSS

hope it helps..^_^

if you're looking for credits YOU will be the one to find by your self..!!

https://facebook.com/admerbakud

PAULiNE

PAULiNE
Level 1
Level 1

thanks

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum