Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
XHTML 1.0 Strict deprecates the use of iframes in favor of objects. While this has gotten a lot of flack, iframes were never truly a part of HTML, just a proprietary element in Internet Explorer that eventually got universal support. Objects are a mo...
0
964
posted 15 years ago by chrisdpratt
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
761
posted 15 years ago by DaveChild
W3C no longer include the target attribute of the <a> tag in HTML 4.0 Strict and XHTML 1.0 Strict document types . To make links open new windows we will have to use Javascript, and with mootools it make this task very easy. Just add this snippet to...
0
847
posted 15 years ago by cherrywaves
Use this function to test whether or not a Javascript object is empty.
2
1026
posted 15 years ago by jlizarraga
I just noticed in Firefox 3.5.2 that setting `disabled = true` for a focused text input seems to make it impossible to re-focus after setting `disabled = false`. The solution is to blur it before disabling.
0
1270
posted 15 years ago by cyberhobo
first of all i thank to our Creator and Mr.ImHugo for his Action script which i make the java script from it,its works fine and once again i gives thank him for his snippet
1
765
posted 15 years ago by sujithfem
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
440
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
796
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
Make sure you change the variable v_ga_track near the end of the script.
0
722
posted 15 years ago by chrisjlee
Detect if an object exists in an array or detect existance of a key in an object
1
730
posted 15 years ago by quickredfox
File.Basename - A library that provides unix-like tools 'dirname' and 'basename'
0
615
posted 15 years ago by quickredfox
Remedial Javascript As Proposed by Douglas Crockford (http://javascript.crockford.com/remedial.html)
0
686
posted 15 years ago by quickredfox
The canvas drawImage size default is 300 x 150, so it's using the CSS to resize the canvas. Example posted at http://pastebin.me/76aed7005b1b413ea3c479287f4dbd59
0
1319
posted 15 years ago by Motty