Welcome To Snipplr
Everyone's Recent Snippets Tagged javascript
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Simple [SoundManager2](http://www.schillmania.com/projects/soundmanager2/doc/download/#latest "Download SoundManager2") example (uses jQuery)
0
928
posted 15 years ago by chrisdpratt
This will get the document's body in a very agreeable manner - it returns the first div on the page if there is no body (hey it can happen).
Adapted from code by Scott Schiller
0
557
posted 15 years ago by remotezygote
Puts a red border around anything with an inline style. Prefix with "javascript:" and paste into the address bar to run on a page directly, or run with a load event.
1
762
posted 15 years ago by DaveChild
Use this function to test whether or not a Javascript object is empty.
2
1029
posted 15 years ago by jlizarraga
I saw a lot of bad javascritp foreach examples ... so here is the best solution. See the link (german) for another snippet to iterate over object properties via foreach.
0
442
posted 15 years ago by naden
Page_ClientValidate is a global function. When called this will return true/false if the validator group provided is valid or not.
0
791
posted 15 years ago by jink
Usage:
//any element
window.onload = function(){
focusFirstInput();
}
or
// form elements under 'content-body'
window.onload = function(){
focusFirstInput('content-body');
}
0
797
posted 15 years ago by neoprolog
The code below will loop through the properties in an object and alert a string. myObject is in JSON notation. The "for ( x in y)" construct does not work if the Prototype.js library is included on the page
0
1281
posted 15 years ago by elugardo
This example demonstrates a way to control Adobe InDesign from Perl. Tested on MacOS X 10.5.7 and INDD.
0
735
posted 15 years ago by myhd
Make sure you change the variable v_ga_track near the end of the script.
0
722
posted 15 years ago by chrisjlee
Remedial Javascript As Proposed by Douglas Crockford (http://javascript.crockford.com/remedial.html)
0
687
posted 15 years ago by quickredfox
Create two new bookmarks - one for dev, one for live and add the following corresponding code to each.
1
884
posted 15 years ago by Meander365
This method is better suited for processing large arrays in the smallest amount of time without affecting the user experience.
0
698
posted 15 years ago by iTony
*save as proxy.jsp and put it in your servlet container
*consider using other methods to circumvent XSS: JSONP, dojox.io.xhrWindowNamePlugin, etc.
1
1277
posted 15 years ago by stoyan
*save as proxy.asxh and put it in your IIS virtual directory
*consider using other methods to circumvent XSS: JSONP, dojox.io.xhrWindowNamePlugin, etc.
0
766
posted 15 years ago by stoyan