Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



Solo funciona para IE
5 102 posted 13 years ago by aurele
If you want your pages to be valid XHTML-Strict, but you also wish to open external links in new window, the following snippet is doing just that—sets attribute target=“_blank” to all external links in a document to keep your code valid XHTML-S...
2 129 posted 13 years ago by zensir
Using CSS is, of course, the preferred method of performing mouseover image swapping, but it's good to have a few tricks up your sleeve. Here's one way of doing it with JS, but the images have to be pre-loaded, or else there'll be a slight lag in the...
1 68 posted 13 years ago by pckujawa
1 121 posted 13 years ago by sondosia
swfObject in XHTML doc structure.
1 110 posted 13 years ago by horizens
added to the head section of the page
5 110 posted 13 years ago by gux
3 81 posted 13 years ago by Corhol
Simple javascript email validation
29 579 posted 13 years ago by arcturus
Simple templating for innerHTML functions. Parses an input string (tmpl) for %(NAME) tokens, accepts an object (ns) as data and returns an output string.
1 77 posted 13 years ago by mattgay
The ideal use of this code would be to save the Javascript code as a .js file. Then use the HTML code at the bottom to call it wherever you want on the web page.
1 94 posted 13 years ago by Jaymoon
I've found a very nice (and standard) solution to firing events while it's not normally available, this piece of code searchs the active element (a text input) inside the Event.observers collection and fires the "onchange" event (normally not possibl...
0 90 posted 14 years ago by alvaroisorna
redirects a splash page if visited before. Number of days until expiry can be set
0 87 posted 14 years ago by markhope
Redirect a splash page using javascript. This snippet allows one redirect per session making the backwards navigation possible using the back button.
0 108 posted 14 years ago by markhope
function prints a serie of random numbers but without the next one being the same as the previous. to print, just call the function in the body
1 162 posted 14 years ago by dandyna
This script reads a directory of files. After reading the directory specified it outputs the directory files. Upon output, supplied functions manipulate each filename and format it to make the output filename look better. e.g.: instead of output bei...
2 179 posted 14 years ago by drewrockshard
This little javascript will toggle the div object to create collpse/expand effect on web page. Treat it as a poor man's solution for the TreeView.
0 78 posted 14 years ago by chengkai
This function allows an object's property names to be read by using an index. The properties can be accessed like: someobject.propertyNames[0] or someobject.propertyValues[0]. But you first have to make the object's properties available by calling so...
2 109 posted 14 years ago by rolandog
Constructs an element out of arrays. Using nested arrays translates into nested ChildNodes. Update 2006-07-19: Added documentation (comments). Update 2006-11-25: Reduced the ammount of code needed.
5 129 posted 14 years ago by rolandog
3 69 posted 14 years ago by masaya
This is test script of Google Map API. How to use this script is as follows. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <style type="text/css"> v\:* { behavior:url(#default#VML)...
5 129 posted 14 years ago by tomute
See javadoc style comment in source.
2 163 posted 14 years ago by ishikawa