Top

Javascript Code Snippets

  (22)  
Sort by 
+ 0 likes
3 comment(s)    Score: 0.0    Platform: Javascript    Posted by vaseline28 on Nov 11, 2009
Just a simple script which uses maths to detect whether or not a year is a leap year or not. If the year inputted
Tags: check  date  detect  javascript  leap  year 
+ 0 likes
0 comment(s)    Score: 0.0    Platform: Javascript    Posted by vaseline28 on Nov 11, 2009
put this where you put html replace 'background' with the background color of your site, replace 'link' with the link you want it to go to, replace 'cmts' with the color you want the text to be when..
Tags: css  dhtml  html  javascript 
+ 0 likes
3 comment(s)    Score: 0.0    Platform: Javascript    Posted by Weasel on Nov 05, 2009
Weasel's first javascript! on your website it pops up an alert with a response depending on the time! put it where you'd put html/javascript!
Tags: popup 
+ 0 likes
3 comment(s)    Score: 0.0    Platform: Javascript    Posted by Weasel on Oct 02, 2009
Use this script to block certain IPs from your webpage, by redirecting them to another site. Note that your web server must have SSI enabled (most Linux servers do), with the page using the correct extension..
Tags: block  ip 
+ 0 likes
1 comment(s)    Score: 0.0    Platform: Javascript    Posted by Kerrie on Aug 23, 2009
This snippet changes the color of an element which is selected from a list when called (OR it can change the color of an object to a specified color).
Tags: change  color  javascript  random 
+ 0 likes
0 comment(s)    Score: 0.0    Platform: Javascript    Posted by vaseline28 on Jan 03, 2009
This is a simple Javascript snippet that lets you toggle a group of checkboxes on or off at the same time. This is the format for your HTML form: You can use this in multiple groups on the same..
+ 0 likes
1 comment(s)    Score: 0.0    Platform: Javascript    Posted by Hawkee on Oct 18, 2008
This is a code that will disable highlighting on a web page. Copy and paste this wherever you want on your web page. It is JavaScript. :)
Tags: highlight  java  javascript  no  script  text 
+ 0 likes
5 comment(s)    Score: 0.0    Platform: Javascript    Posted by Sapphy on Oct 05, 2008
This, is my first attempt of doing some javascript.. so there may be errors, but it does work! Put the first part, into a php, or html file, etc the second part, just needs to be put in a "clock.js"..
Tags: a  attempt  clock  first  javascript  of 
+ 0 likes
0 comment(s)    Score: 4.0    Platform: Javascript    Posted by escriptirc on Sep 21, 2008
I find that lots of people new to AJAX can't get the grips because they don't understand the XMLHttpRequest, below is a help to that - this will handle the request, all that you have to fill in is the..
Tags: ajax  content  dynamic  help  javascript  request  xml 
+ 0 likes
14 comment(s)    Score: 6.0    Platform: Javascript    Posted by vaseline28 on Sep 13, 2008
This is a very simple Javascript toggle that'll show or hide a div depending on its current state. Here is the HTML code:
+ 1 likes
11 comment(s)    Score: 0.0    Platform: Javascript    Posted by Hawkee on Sep 10, 2008
Script is relatively simple, credit should be shown to several tutorials, particularly those on AJAX in www.w3schools.com I HAVE used my own work though :-) What I find I love about AJAX is that..
+ 1 likes
7 comment(s)    Score: 5.0    Platform: Javascript    Posted by vaseline28 on Sep 09, 2008
If you're a little unsure on Javascript, I recommend that you use the simple version of the script found
+ 1 likes
8 comment(s)    Score: 7.0    Platform: Javascript    Posted by vaseline28 on Jul 12, 2008
+ 0 likes
10 comment(s)    Score: 6.0    Platform: Javascript    Posted by vaseline28 on Jul 06, 2008
Simple redirect, if you go to URL "REDIRECT FROM", you will be redirected to "REDIRECT TO". For example, if I move domain name, I could put in the homepage of my old domain (e.g...
+ 0 likes
4 comment(s)    Score: 0.0    Platform: Javascript    Posted by vaseline28 on Jul 01, 2008
I used this function on my latest website, found it came in handy and looked real nice; Put this into any html page, the put this code for the bit that's to be toggled; This is REALLY effective..
+ 0 likes
13 comment(s)    Score: 8.3    Platform: Javascript    Posted by jonesy44 on Jun 25, 2008
pretty straight forward. Get the code, save it in a filename.html then run it. Hover over one of the sites named above the horizontal line to get further information below. This is just to help some..
+ 0 likes
9 comment(s)    Score: 6.3    Platform: Javascript    Posted by F*U*R*B*Y* on Jun 19, 2008
Umm...I'm a bit new to Javascript, this is my first script in it o.0
Tags: first  javascript  my 
+ 0 likes
22 comment(s)    Score: 1.0    Platform: Javascript    Posted by pokemaster23 on Jun 08, 2008
This is my first javascript snippet on here, there are no "errors" as such, but i'm fairly sure i've done it in the longest way possible !
Tags: form  javascript  js  login 
+ 0 likes
5 comment(s)    Score: 5.0    Platform: Javascript    Posted by jonesy44 on Apr 26, 2008
1. Copy/Paste this code in NotePad 2. Save As... snow.js 3. Upload on your hosting 4. Add this code to your web-site
Tags: javascript  js  snow 
+ 0 likes
5 comment(s)    Score: 0.0    Platform: Javascript    Posted by Anarchy[MKD] on Jan 08, 2008
This was used in our The display is either "none" if we don't need to show the "Full Review" link or "inline" which will make the dots appear after the cut-off text.
Tags: css  cut  end  long  php  string 
+ 0 likes
2 comment(s)    Score: 8.5    Platform: Javascript    Posted by Hawkee on Mar 24, 2007
This will copy the text in a given field to the clipboard. Unfortunately it only works in IE, so Firefox users will still need to do the actual copy. But it'll at least select the text for Firefox users. Here..
Tags: clipboard  copy 
+ 0 likes
5 comment(s)    Score: 7.0    Platform: Javascript    Posted by Hawkee on Mar 24, 2007
Bottom