Home  | Articles, Tips & Tutorials Library  | Q&As  | Web Hosting Tips  | Useful Tools & Resources  | Online Business Dictionary  | Home Based Work  

12 Useful HTML and Javascript Tricks (Part 5)


9. Cloaking Your Affiliate URL On a Web Page

At times you'll be promoting an affiliate program within the context of a web page. Some readers may bypass your affiliate link. To avoid being cheated of a commission, some affiliates "disguise" their affiliate links with this simple piece of code:

<A HREF="http://www.youraffiliateURL.com" onmouseover="window.status='http://www.mainsite.com'; return true;" onmouseout="window.status=' ';return true;">Click here to visit ABC</A>

Normally a visitor who places their mouse over a clickable link on a website will see the URL at the bottom of their browser. With this code snippet, the visitor sees whatever URL (or text) that you decide to show them. In the above code, instead of seeing:

http://www.youraffiliateURL.com

… at the bottom of their browser, your visitor sees the URL:

http://www.mainsite.com

… and on the actual web page, the blue underlined link is displayed as:

Click here to visit ABC

10. Add Your Site to the 'Favorites' List

To encourage your visitors to bookmark your site, make it a simple "one-click" process for them. This trick works with Internet Explorer 5+ only:

<SPAN style='color:blue;cursor:hand;' onClick='window.external.AddFavorite(location.href, document.title);'> <FONT FACE="Arial, Helvetica, Sans Serif">Internet Explorer Users: Click here to add this page to your list of favorites.</FONT> </SPAN>

The above code creates a link that looks like this:

Internet Explorer Users: Click here to add this page to your list of favorites.

When your visitor clicks on the link, Internet Explorer opens up a window so that he or she can save your site to their 'Favorites' list.

11. "One-Click" Email Links: Prefilling the Subject or Body

Sometimes you may need a user to enter a specific word or phrase into either the subject line or the body of an email.

  1. To prefill a subject line: <A HREF="mailto:youraddress@yourdomain.com?Subject=Your Subject Line">Click here to email me</A>

  2. To prefill the body of the message: <A HREF="mailto:youraddress@yourdomain.com?Body=Message body text">Click here to email me</A>

  3. To prebill BOTH the subject line and the body: <A HREF="mailto:youraddress@yourdomain.com?Subject=Your Subject Line&?Body=Message Body">Click here to email me</A>

12. Displaying Special Characters On Your Web Page

Some characters such as < and > have special meaning in HTML. To display them properly on your web page, you can use special "codes". Here's a quick list of some common codes:

Code: Displays as:
&quot; "
&lt; <
&gt; >
&amp; &
&copy; ©

BigNoseBird offers a chart with all displayable characters.

PREVIOUS: 12 Useful HTML and Javascript Tricks (Part 4)
NEXT: Helpful Web Design Sites and Tools


© Copyright 2004, onlinebusinessbasics.com. All Rights Reserved.

Please contact us to request reprint permission.

© Copyright 2002-2009, Online Business Basicstm. All Rights Reserved.
Privacy Policy