Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



1 ... 38 39 40 41 42 ... 46
0 1239 posted 17 years ago by wizard04
(Created for JavaScript) These are rather forgiving. Spaces, dashes, or periods are allowed as separators. Extensions can be recognized by several strings (#, x, x., ext, ext., extension). Area code: $1$2 Exchange code: $3 Station code: $...
1 2313 posted 17 years ago by wizard04
When there's a URL on a page that's not a link, just highlight it and click this bookmarklet. The URL will open in a new window. If there are multiple selections (e.g., if you've selected something in each of two frames on the page), they will eac...
1 1343 posted 17 years ago by wizard04
Convert a number to a different base.
0 1503 posted 17 years ago by wizard04
Select some text, click the bookmarklet, and the definition(s) will open up in [Ninjawords](http://www.ninjawords.com). [Ninjawords](javascript:(function(){function%20t(f){try{if(f.getSelection)return%20f.getSelection().toString(&#...
0 1019 posted 17 years ago by wizard04
This simple little snippet will allow you to change two iframes with the click of just one link.
1 1447 posted 17 years ago by aristoworks
0 1110 posted 17 years ago by fredaudet
`Events.add(element, type, handler)` adds a handler to an element `Events.remove(element, type, handler)` removes a handler from an element `Events.getTarget(event)` or `Events.getOrigin(event)` returns the element from which the event originat...
1 1744 posted 17 years ago by wizard04
Functions to use the clipboard. Requires a Flash file for non-IE browsers: see [http://javascript.internet.com/forms/clipboard-copy.html](http://javascript.internet.com/forms/clipboard-copy.html) Remember to set `config.Clipboard.pathToFlash` a...
1 1195 posted 17 years ago by wizard04
There is no standard for this at all - this just looks for the hooks that exist in IE and gecko-type browsers. See also http://msdn.microsoft.com/en-us/library/ms535926(VS.85).aspx and http://developer.mozilla.org/en/docs/DOM:window.sidebar
3 1463 posted 17 years ago by scarfboy
Exploits hash keys uniqueness, but in doing so effectively toString()s everything, meaning this should not be used for much beyond strings and perhaps integers. I used this when I wanted to do some client-side filtering of (integer) identifiers.
1 1297 posted 17 years ago by scarfboy
Useful functions to get around browser incompatibilities when working with stylesheets. If you find any errors, please leave a comment.
0 1395 posted 17 years ago by wizard04
sample: var text = " string content "; text = text.trim();
2 1280 posted 17 years ago by donkeykong
Use sample: var inputTxt = getElementsByAttr('input', 'type', 'text');
1 1230 posted 17 years ago by kcmr
Matches single line Javascript (and PHP, etc.) comments
1 1333 posted 17 years ago by mikegreen
Matches CSS-style comments spanning one or multiple lines
2 2107 posted 17 years ago by mikegreen
0 1387 posted 17 years ago by johnloy
8 1677 posted 17 years ago by mdi
(Supported by JavaScript, maybe other languages)
3 6962 posted 17 years ago by wizard04
1 1210 posted 17 years ago by johnloy
3 1826 posted 17 years ago by johnloy
Firefox ignores the alt tag on images and uses the title tag whereas IE uses the alt tag. This javascript code copies the text in all image alts to the image's title. Best when placed at the footer of each page
1 1550 posted 17 years ago by ezerick
0 1093 posted 17 years ago by johnloy
1 1349 posted 17 years ago by rwczippy
1 ... 38 39 40 41 42 ... 46