Welcome To Snipplr
Everyone's Recent Snippets Tagged javascript
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
I wrote this very quickly for a form I parse that allows a user to send a page to up to 5 friends. The script adds a click event to an image of a + sign beside an input box. When clicked if the user hasn't already added 5 friends to email, additional...
9
1134
posted 16 years ago by dmosher
Just to include and implement the SWFObject to an HTML body from a generic "/js/" directory with some basic varibles.
[applies to OLD version of SWF Object]
1
655
posted 16 years ago by mattkenefick
A Tiny JavaScript liberary for Behaviour-Driven Development (BDD).
1
912
posted 16 years ago by ishikawa
This is the javascript file for code which implements the Secure Hash Algorithm 1 as defined in FIPS 180-1 published April 17, 1995.
1
980
posted 16 years ago by ishikawa
Slim down the size of your javascript by using these custom functions.
2
739
posted 16 years ago by neal_grosskopf
/* if (globalVariable) {
But this wouldn't work. That code is actually checking to see if the defined variable globalVariable has a null value. If the variable has not been defined, that code will cause an error.
Instead, here is the code that...
0
608
posted 16 years ago by zha
Flash sucks, embedding it sucks more, find out how to make it not suck.
2
1058
posted 16 years ago by neal_grosskopf
Note that the comment is part of the code here. IE 5+ (including Mac) will evaluate to true by using conditional compilation.
0
798
posted 16 years ago by cczona
*"Only the elements which are are selected through the $ selector will get the extra DOMAssistant methods added to it."
0
611
posted 16 years ago by cczona
How to use:
1) < script type="text/javascript" src="path-to-file.js"...
2) < body onload="oHW.preMontar('img1_on.jpg','img2_on.jpg','img3_on.jpg');"...
3) < a href="#" onmouseout="oHW.Restore()" onmouseover="oHW.Cambiar('mnind','img1_on.jpg'...
2
1010
posted 16 years ago by hellion
Use this snippet to quickly insert onclick="window.open();" into your HTML...
---
Snippets can save you time and hassle of typing out bits of code that you frequently use by adding them into your files by simply double-clicking the name of the Sn...
1
876
posted 16 years ago by hellion
I got this code from http://blog.vishalon.net/Post/57.aspx
The actual two methods required are
function doGetCaretPosition (ctrl) {
var CaretPos = 0;
// IE Support
if (document.selection) {
ctrl.focus ();
var Sel = document.select...
3
4325
posted 16 years ago by arunpjohny
/* ---===[ EXAMPLE ]===--- */
var TT = new AssociativeArray();
TT.add("k-1", "Value 1");
TT.add("k-2", "Value 2");
TT.add("k-3", "Value 3");
TT.add("k-4", "Value 4");
alert(TT.to_string());
1
632
posted 16 years ago by vbert
/* --==[ EXAMPLE ]==--
var colors = new AArray();
colors.add("k01", {bk:"#fff",tk:"b",it:"hello"});
var oC = colors.get("k01");
var tT = '';
for(K in oC) tT += "[" + K + "]: " + oC[K] + "\n";
tT += "\n\n";
tT += oC.bk + "\n";
tT += oC...
1
975
posted 16 years ago by vbert