|
A great way to get started with JavaScript is
to try copying and pasting a few prewritten scripts. There are lots of
sites that offer hundreds of free scripts for you to use that are all
ready prewritten. Just go to your favorite search engine and do a search
for free java scripts, you'll be amazed at the wealth of information
that's out there. Here's a very simple tip. This JavaScript tip or trick, will send the visitor
back to the page
they were previously on.
Hint: This
has a cool use inside pop up windows and when using forms.
<a href="javascript:history.go(-1)"
onMouseOver="self.status=document.referrer;return true">Go Back</a>
Instructions: First copy the above script
and paste it in a blank note pad page. Then
re-copy it to your clip board.
Next place your curser on the spot you would like your link to appear on
the page, and then switch to HTML view. Paste the script in the spot your
curser is blinking. Save your changes and then switch back to Normal View.

Print This Page
Here's a JavaScript that has a lot of
uses and its so easy to use. It allows you to print the current page by
clicking on a link.
Instructions: First copy the script
below,
and paste it in a blank note pad page. Then
re-copy it to your clip board.
Next place your curser on the spot you would like your link to appear on
the page, and then switch to HTML view. Paste the script in the spot your
curser is blinking. Save your changes and then switch back to Normal View.
This part goes in the <
Head
> Section
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
// End -->
This part goes in the <
Body
> Section
<a href="javascript:printWindow()">Print
This Page</a>

Print Window with Button
Instructions: First copy the script
below
and paste it in a blank note pad page. Then
re-copy it to your clip board.
Next place your curser on the spot you would like your link to appear on
the page, and then switch to HTML view. Paste the script in the spot your
curser is blinking. Save your changes and then switch back to Normal View.
This part goes in the
<
Head
> Section
<script type="text/javascript">
function printpage()
{
window.print()
}
</script>
This part goes in the
<
Body
> Section
<form>
<input type="button" value="Print this page" onclick="printpage()">
</form>
Browser Resize:
Instructions: First copy the script
below
and paste it in a blank note pad page. Then
re-copy it to your clip board.
Easily resize your browser
window by typing the following into the address bar, adjusting the numbers
to reflect the screen size you want:
javascript:resizeTo(800,760);moveTo(0,0)
Add to Favorites:
Instructions: First copy the script
below
and paste it in a blank note pad page. Then
re-copy it to your clip board.
This part goes in the
<
Head
> Section
<script>
function BookmarkPageNameHere()
{
if (document.all)
{
window.external.AddFavorite(location.href,'PageNameHere');
}
else
{
alert("Netscape users: To add this site to your bookmarks click 'OK' then
press (CTRL-D)");
}
}
</script>
Instructions: First copy the script
below
and paste it in a blank note pad page. Then
re-copy it to your clip board.
Then put this in the <
Body
> Section
where you want the link to be:
<a href="javascript:void(0)" onClick="BookmarkPageNameHere
();">Bookmark this page</a>
Hide Email Address from Spam Harvesters:
<SCRIPT language="javascript">
<!--
var contact = "Contact Us"
var email = "webmaster"
var emailHost = "yourname.com"
document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">"
+ contact + "</a>" + ".")
//-->
</SCRIPT>
|