Computer Science Canada Some Useful Javascripts |
Author: | [Gandalf] [ Mon Jul 11, 2005 9:23 pm ] | ||||||||
Post subject: | Some Useful Javascripts | ||||||||
Well, I was recently working with JS for a while, and I accumulated a few pretty useful scripts. This script shows some information about the users browser. You can easily change this code to customize the page according to the different capabilities available. I didn't create this one, just modified it.
This script makes sure that both IE users and netscape (mozilla or firefox or many others) ones can't right click on your site. This includes no viewing of your source code (although there are various ways to get around this).
This function is useful if you want to scroll down the site automatically. I found this useful for automatically scrolling down the page when there are ads so that half of your openign page isn't covered. Sadly, this doesn't always work. If you want the page to automatically scroll when it loads you have to add this to your body tag: <body onLoad="jumpScroll()">.
This simple code puts the previous page you visited, only if there was a page though.
Hope some of them come in handy. This is pretty much how I learned some of JavaScript, just looking at examples, maybe you will too! I will keep adding more as I learn and explore . |