JavaScript – Advance Ads Rotator v1.32 Hybrid




Tagged Under : , , ,

Version: 1.32 Hybrid
Revision: 34 Build 12

JavaScript – Advance Ads Rotator v1.32 Hybrid

Introduction:
on the 6th of June, my Gmail inbox was dominated by a bunch of users!
They asked me, if I can create another “JavaScript Ads Rotator” that gives individual users’ more control over their banners. Well… this is a pretty good excuse to get my brain working!

If you want to use this new script, please feel free to copy and use it on your website, blogs or forum. However, please don’t remove any of my comments, especially my copyright regulations and rules!

Thank for your support!

Lair360 ~ Administrator

1.] Download notepad++ from the original author or from another source.
——————————-

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

http://filehippo.com/download_notepad/

——————————-

2.] Copy this ‘JavaScript’ source code and save it as “ad-rotator.js”.

File: ad-rotator.js
—Copy Source Code—

// Version: 1.13 Hybrid
// Revision: 36 Build 21
// Copyrighted by Lair360
// Url: lair360.co.uk/blog/
// *******************************
// If you're using more than three ADS, please change
// the default number.
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
// *******************************
// Replace your own images, banners and urls.
if (ad==1) {
url="http://url-1.com";
alt="url-1.com";
banner="1.gif";
width="125";
height="125";
}
if (ad==2) {
url="http://url-2.com";
alt="url-2.com";
banner="2.gif";
width="125";
height="125";
}
if (ad==3) {
url="http://url-3.com";
alt="url-3.com";
banner="3.gif";
width="125";
height="125";
}
// Modifications Ends Here.
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" ')
document.write('width=\"' + width + '\" height=\"' + height + '\" ');
document.write('alt=\"' + alt + '\" border=0><br></a>');
document.write('</center>');

—End Source Code—

3.] Finally, you’ll need to add this ‘html – string’ into your webpage.

—Copy Source Code—

<script type="text/javascript" language="Javascript" src="ad-rotator.js"></script>

—End Source Code—

4.] Save your webpage and exit. After that, just alter the above JScript with your own images and links.

5.] Finish!

Copyrighted by Lair360




JavaScript – Copyright Updater




Tagged Under : , , ,

Version: 13.2
Revision: 43 Build 19

JavaScript – Copyright Updater

Introduction:
after reading and working with JavaScript, I was trying to create an automatic “Copyright” updater for the public. This script wasn’t long, but it will let others know that your articles were written by you and you are the owner of this written material.

1.] Download notepad++ from the original author or from another source.
——————————-

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

http://filehippo.com/download_notepad/

——————————-

2.] Copy this ‘JavaScript’ source code and save it as a “.js” extension.

File: javascript-file.js
—Copy Source Code—

document.write('©' );
document.write('  2004 - ');
document.write(new Date().getFullYear());
document.write(' <website name> - All Rights Reserved.');

—End Source Code—

Notes: you’ll need to change the default year (2004) and “” with your own.

3.] Import this Javascript file into your html / php file, with this ‘import’ function.

—Copy Source Code—

<font color="#F8F8FF">
<!-- Begin Copyright Code -->
<script type="text/javascript" language="Javascript" src="javascript-file.js" /></script>
<!-- End Copyright Code -->
</font>

—End Source Code—

Notes: you’ll need to replace “javascript-file.js” with your own (saved) file.
Also, if you have a white background, you’ll will need to change your “fonts” color into another colour, so that the other users could see your copyright notices!

4.] Now, save your progress and check your website!

Notes: if you want to add this “JScript” into a single ‘html’ file, you can use this alternative method…

—Copy Source Code—

<font color="#F8F8FF">
<script type="text/javascript" language="JavaScript">
<!--
document.write('&copy;' );
document.write('  2004 - ');
document.write(new Date().getFullYear());
document.write(' <website name> - All Rights Reserved.');
//-->
</script></font>

—End Source Code—

5.] Done!




JavaScript – Script Loader




Tagged Under : , , , ,

Version: 13.2
Revision: 32 Build 11

JavaScript – Script Loader

Introduction:
this tutorial is about loading multiple script without delays.
But, this script is a little more basic and it should be easy enough to master…

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.] Copy this “JS script” and save it as a “.js” extension.

Tips: you can add more than one “scriptLoader” into your script.

File: script_loader.js
—Copy Source Code—

/**
 Copyrighted by Lair360
 Version: 19.1a
 Revison: 11 Build 8
 */
function scriptLoader(url)
{
   document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}
//Loads external external script
   scriptLoader("demo.js");

—End Source Code—

Notes: you’ll need to replace “demo.js” with your own javascript file.
That is all…

3.] Add this html – snippet and place it in the “head” tags.

—Copy Source Code—

<script src="script_loader.js" type="text/javascript"></script>

—End Source Code—

4.] Save your webpage and test your website!

5.] Finish!

Copyrighted by Lair360




CSS StyleSheet – Horizontal align for javascript




Tagged Under : , , , ,

Version: 43.3
Revision: 54 Build 143

CSS StyleSheet – Horizontal align for JavaScript

Introduction:
there are times that your company has given you a piece of code that uses JavaScript language. But, when you added the following codes into your left or right table, it always placed itself right at the edge of your template. So, to work around this problem, you’ll need some knowledge on CSS stylesheet and html format – that is all you need!!

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/

——————————-

Part One: basic stylesheet knowledge…
————————-
a.] all “div” tags and “td” tags are very different.
But, the most important tags which are used for javascript is the “div” tags.
b.] Everytime you insert a javascript link, you’ll need to add these codes in order.
However, if you don’t follow this simple rules, your JavaScript will not be visible by other readers.

JavaScript – table orders: div >> h2 >> script + noscript >> script + noscript – escaped >> h2 – escaped >> div – escaped

c.] To align JavaScript (manually), you’ll need to insert “h2” tags. Without this tags, the browser will ignore your javascript floating point. So, you’ll need to add this after your div tags.

d.] All “td” tags have to be anchored into a “table” tag. Without it, your “td” tags and JavaScript will trigger errors and serious table overflow! But, please think carefully and take a look at your source before you continue.

Part Two: preparing your table and stylesheet
————————-
1.] Create a css stylesheet – file with this name: Java_ads.css

2.] Paste this source code into your css file and save it…

—Copy Source Code—

h2.adsbox, #adclass1 {
float: left;
position:relative;
left: 10px;
right:0px;
}

—End Source Code—
Copyright 2001-2009 Lair360


Extra precaution: if you’re copying the above codes into your css stylesheet, you’ll need to hard – anchor your “h2.adsbox” tags before adding your id tags: “#adclass1”. If you don’t organize this code in their proper orders, there is going to be some misleading call by the server…

h2 = sub-table tags
.adsbox = primary class tags
#adsbox = id verification tags


3.] Now, open your page and add this code into your html page.
But, this code will need to be in your “td” tags and your table tags…

Tips: This technique is similar to an iframe. But, its not!
You can also safely use this source for your ads. It’s also easy to configure!!

—Copy Source Code—

<div>
<h2 id="adclass1" class="adsbox">
		<!-- Begin example code -->
<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://example-code.com/java_example.js" type="text/javascript"></SCRIPT>
<noscript><a href="http://www.example-code.com">example</a></noscript>
			<!-- End example code -->
		<a href='http://www.copygator.com/website/lair360_co_uk/4540887.html'>
<img class="gator2" src='http://i.copygator.com/?ci=4540887' border="0" vspace="1" /></img></a>
</h2>
</div>

—End Source Code—
Copyright 2001-2009 Lair360


Notes: you can also add an image source code. But, you must be very careful and add a backslash before adding an image – escape code. This will stop your “img” tags from colliding with your JavaScript tags.

4.] Save your html file and adjust your css stylesheet.

Tips: if your JavaScript is floating on your right – panel, you’ll need to modify your “float position: right; left:0px; and right;10px;”.

5.] Finally, just add this code into your “head” ~tags. But, don’t put this before your javascript links, or else, there will be some conflict!

—Copy Source Code—

<link rel='stylesheet' type='text/css' href="css_file/Java_ads.css" /></link>

—End Source Code—

6.] Finish!

Copyrighted by Lair360




JavaScript Tutorial – How to reduce loading time




Tagged Under : , , , , ,

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!