[Urgent] OMG!! This is hitting my head!! Please help!!!

lair360

New Member
Messages
200
Reaction score
0
Points
0
Hi everyone! I am creating this script and its driving me crazy!!!!
I don't know if this JavaScript will load all of my JScript first and let the page load second....

Could you please check if its correct?????

Thank you!

----------------------------
Code:
<script  language="Javascript" type="text/javascript">
<!-- hide from non JavaScript Browsers

if (!window.addScript)
{
    window.addScript = function (src, callback) {
        var head = document.getElementsByTagName("head")[0];
        var script = document.createElement("script");
        script.src = src;
        script.type = "text/javascript";
        head.appendChild(script);
        if (typeof callback == "function") callback();
    };
}

window.addOnLoad(function () {
    window.addScript("image_preload.js");
    window.addScript("http://pub.oxado.com/insert_ad?pub=220440");
    }
);
// -->
</script>
Please look and see if its correct....

Also, for those who correct any mistake will recieve 200 points!
The winner will be allowed to use this code for their website!
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
The best and simplest way to include the JS that you want is to directly include it:
Code:
<script  language="Javascript" type="text/javascript" src="image_preload.js"></script>
<script  language="Javascript" type="text/javascript" src="http://pub.oxado.com/insert_ad?pub=220440"></script>
 

lair360

New Member
Messages
200
Reaction score
0
Points
0
The best and simplest way to include the JS that you want is to directly include it:
Code:
<script  language="Javascript" type="text/javascript" src="image_preload.js"></script>
<script  language="Javascript" type="text/javascript" src="http://pub.oxado.com/insert_ad?pub=220440"></script>

I would like to use my type so that it could cache the JScript faster (dynamically).
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Well I don't seem to see any problem with your script. Could you give me an url...
 

lair360

New Member
Messages
200
Reaction score
0
Points
0
I've inserted it into my hompage, please click clear your internet caches first and click on my Signature....

Tell me how fast it loads...
Edit:
Is this part correct???

Code:
window.addOnLoad(function () {
    window.addScript("image_preload.js");
    window.addScript("http://pub.oxado.com/insert_ad?pub=220440");
    }
);
// -->
</script>
 
Last edited:
Top