JavaScript Code Snippets


Javascript append function "DOM Append Text and Element Functions"

The Gmail Bookmarklet will add a unique string to the email signature to prevent Gmail from trimming the content.

29 December, 2016   

JavaScript code snippet to test if Mac or PC

21 December, 2016   

Convert Polygon to Path Data code snippet by Chris Coyier

A JavaScript implementation of the famous sprintf() function

11 September, 2016   

Website won't display in a frameset. Site will jump out of the frameset.

24 July, 2016   

Dynamically add form fields to your forms.

28 June, 2016   

JavaScript code example for Parse Zapier apps list

Use this in the <head> of your HTML files.

13 December, 2015   

Bind onload function to the iFrame and set the size of the iFrame to the iFrames loaded content. In the example jQuery is used.

18 November, 2015   

Bind onload function to the iFrame and set the size of the iFrame to the iFrames loaded content. In the example jQuery is used.

01 November, 2015   

Returns a random number.

Confirm a deletion (or any action) with Javascript.

12 February, 2015   

JS sniffer detects browser and OS.

21 January, 2015   

Cool script changes your SELECT elements into a Select/Combobox element. Works in Firefox and IE 6+.

31 December, 2014   

Function that allows a Javascript cookie to be set after HTML has been output to the page.

19 November, 2014   

Enable a link after a set period of time.

13 November, 2014   

Here is a form that asks for Name and Email address. When the form is submitted the Email address is verified first. If you put in a Name and a correct Email address, an anchor element is displayed allowing the user to download the file, two cookies are created storing the Name and Email address. If the user goes BACK in the browser and tries...

16 October, 2014   

When hover your mouse over a link, a small box containing contents from another page comes up. This will show the iframe with scrollbars if content (target page) is too big.

08 October, 2014   

JavaScript code to detect browser and OS.