Tips And tricks
to get the best from SBI

cool
header

Free javascripts

The most commonly asked for

Keep an eye on this page, and check back. Sorry I haven't had time to put them all up yet, but it won't be long. I'm working on an "uncrackable" password script at the moment, so that will be up soon....I hope. Promise! ;-)

**************************************************

Hide an affiliate link in the status bar.

Often, the vendow will have cloaking of the link. However, if you hover over the link before clicking on it, then the affiliate ID will still show in the status bar. Here's how to hide that.

<a href="X" onmouseover="window.status='Y'; return true;" onmouseout="window.status=''; return true;">Your link text or banner</a>

X=your affiliate ID and link info. Y=Text to display in status bar.
I haven't tested this in all browsers. however, if it won't work, you're no worse off....the link will still work.

**************************************************

List Your Links

Okay, so this isn't requested a lot, but why would you ask for something if you don't know about it? I think you will find it very useful, in the right circumstances.Click on the button below and see what happens.

Pretty cool huh? Have you got one of those long tier 2 pages, broken up into sections with anchors, and links off to assorted tier 3 pages? Then perhaps a button like this could help your visitors see all the links at a glance, without cluttering up the page with a big long list. Heres the code for this.Place this in the head of your page

<script type="text/javascript"> <!-- Begin function showLinks() { text = "The following links are available on this page:<hr>"; windowprops = "menubars=no,location=no,toolbars=no," +"scrollbars=yes,width=350,height=350,top=100,left=100"; self.name="main"; for (i=0; i<document.links.length; i++) text += "<p><a target='_new' href="+document.links[i]+">"+document.links[i]+"</a>"; linkswin = window.open("","",windowprops); with (linkswin.document) { open(); write(text); close(); } } // End --> </script>

Now place this in the body of the page, where you want the button to appear.

<form> <input type="button" value="View a List of Links" onClick="javascript:showLinks()"> </form>

**************************************************

Display HTML On A Webpage

Actually, this has no business at all being on this page - it's not a script at all. But not to worry ;-) I think you're going to like this, if you dont already know it. So, how did I get the code above to display, without the use of a textbox, and without using the common &lgt tag?. Very simple - HTML supports a tag especially for this purpose.

< xmp > and < /xmp >

Just wrap your code in these tags, and it will display as written. Is that easy or not? Simple and practical.
Note that if you decide to do this with a php script, it WILL execute, as php is serverside, and HTML is clientside. You will need to change the ?php tag to disable it.


Copyright© SBI-Help 2007-2008