JavaScript Tutorial – How to reduce loading time

Version: 43.3
Revision: 54 Build 13

JavaScript Tutorial – How to reduce loading time

Introduction:
this script was designed and tested with different browser: “Firefox, IE7, IE8 and Google Chrome.”

This Javascript engine allows the server to load all javascript in parallel mode without reducing your servers’ performances. After that, it will cache all of your script, so that the server will not upload it again! However, this javascript requires: “Java Runtime Environment.” The application can be found here: http://filehippo.com/download_java_runtime/

——————————-

1.] Download notepad++ from the original author or from a mirror and install the software.
——————————-

http://sourceforge.net/projects/notepad-plus/

http://filehippo.com/download_notepad/

——————————-

2.] Create a Javascript file and save it as: “java-preload.js” (without the quotes).
3.] Copy these script into your new JavaScript file…

—Copy Source Code—

/* Start of JavaScript */
/* Author: Lair360
  Version: 34.5
     Revision: 65 Build 12

http://lair360.co.uk

*/
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("object-one.js");
		window.addScript("object-two.js");
});
$(function () {
    $.getScript("object-one.js");
		$.getScript("object-two.js");
});
/* End of JavaScript */

—End Source Code—
Copyright 2001-2009 Lair360


4.] Save your “JSscript”; replace object-one.js and object-two.js with your javascript files or links (that has javascript).

5.] Double check your script and save it again.

6.] Use this code below and add it to your ‘page – header’…

Notes: you you’ll need to change the file’s location if the JSscript is in a subfolder.

—Copy Source Code—

<script type="text/javascript" language="Javascript" src="Js-Engine.js" ></script>

—End Source Code—

7.] Upload them to your server and check your website!
But, you must clear your Internet Temporary files and cookies for the changes to take effect!

8.] Finish!

Comments are closed.