Text Links Ads : Marketing Tips Store : Search Engine Optimization Strategies
WebPosition Gold Pro : Domain Registration Bank : Optilink Software : GoDefy
Mike's Marketing Tools : Mike's Ecommerce Software : Text Links Guide
 
Web HTML-HTML.com
You are here: HTML Codes > Anchors and Links > Back Link

Back Link: The Basics

The first step in implementing the back link is to download backlink.js and upload it to your server. Load backlink.js into your web page with a <SCRIPT SRC="..."> tag like this:

<SCRIPT TYPE="text/javascript" SRC="backlink.js"></SCRIPT>

backlink.js is implemented by putting a short script in your page. that creates a backlink object, sets various optional properties of the object (we’ll go over all of them later in this section), then calls the write() method of the object. For example, the following script uses a the backlink code in its simplest form, creating a backlink object, then immediately writing it out:

1
2
3
4
5
6
<SCRIPT TYPE="text/javascript">
<!--
var bl = new backlink();
bl.write();
//-->
</SCRIPT>

which gives us this back link:

Let's take a look at this basic example.

Line 1 opens the script element and line 2 sets the obligatory comment for older browsers. Line 3 creates a backlink object, storing it in the bl variable. Line 4 then calls the backlink object’s write() method which writes out the HTML code for the link. Line 5 closes the comment and line 6 closes the script element.

No History, No Link

The backlink object uses object detection to test if the history.back() method works. If the browser does not support history.back(), or if the browser is in the first page it has loaded since the browser opened (i.e. there is no page to go "back" to), then the back link is not written out. This is why it is better to use a scripting object to write out the link instead of hardcoding the link into the page.

Now let's look at customizing the back link.

Back Link: Setting the Text >>>

Copyright © 2002-8 Art Dacor USA LLC. All Rights Reserved.
3727 West Magnolia Blvd #489, Burbank, CA, 91505, USA.
www.HTML-HTML.com