Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged javascript



« Prev 1 2 3 4 5 ... 34
<p><div id="calc"> <p><b>VAT rate:</b> <input type="text" id="vat_rate" placeholder="20" size="10" value> <p><b>Net price:</b> <input type="text" id="net_price" size="10" value> <p><b>Gross price:</b> <input type="text" id="gross_price" size="1...
0 806 posted 5 months ago by antonykidless
This code is used to get the unique values of an array.
0 822 posted 6 months ago by jlustre
JavaScript is a client-side as well as server side scripting language that can be inserted into HTML pages and is understood by web browsers. JavaScript is also an Object based Programming language. Example Note: This is an example, you can change...
0 912 posted 8 months ago by priyagchaudhary
JavaScript regex for validating IP addresses, has been tested!
0 145 posted 2 years ago by plasticbottle
This snippet code allows you to prevent the viewer from being able to right-click on your page. This can discourage the average user from borrow images or code from your site.
0 165 posted 3 years ago by apphp-snippets
A one-liner that converts a decimal number to a binary number
0 159 posted 3 years ago by rm1984
How to pass a parameter into a method from an onClick method found in the render method. Majority of the times when you need to do this, your adding it through a loop. In this case, call a function where the item in the loop will automatically be...
0 132 posted 3 years ago by heathbo
ResponsiveBootstrapToolkit : https://github.com/maciej-gurban/responsive-bootstrap-toolkit
0 132 posted 4 years ago by dhjapan
Use ref with getDOMNode() to get the actual html. Using getBoundingClientRect() on the actual html will give you the width, height, etc. Below: specs = ClientRect {} bottom: 269 height: 18 left: 797.546875 right: 1062.609375 top: 251 width: 2...
0 242 posted 4 years ago by heathbo
Within a react component. How to gain access to the HTML that was just rendered. Any returned html element that is tagged with a ref, can easily be accessed by it's ref after it's been rendered. In the below case, use this.refs["domainModal"] to...
0 133 posted 4 years ago by heathbo
When creating a new https://codepad.co/ snippet, the default language will be set to 'JavaScript'.
0 158 posted 4 years ago by avansare
You know that iFrames are a necessary evil for many of us. When yuo put a third party site in an iframe is always a risk because they can break out of that iframe and redirect the visitor to another location. This code acts as a defense for such case...
0 135 posted 4 years ago by apphp-snippets
Sometimes you may want to show the visitor that you are aware of their IP address. You can do so by using few lines of code as shown here. Place the code in any place of your page, where you want the IP address to appear:
0 160 posted 4 years ago by apphp-snippets
To do this for any object in JavaScript will not be simple or straightforward. You will run into the problem of erroneously picking up attributes from the object's prototype that should be left in the prototype and not copied to the new instance. If,...
0 181 posted 5 years ago by BrentS
delete Operator don’t impact the length of Array in JavaScript
1 153 posted 5 years ago by ursdeep
The key to making it work is the event listener that get added using the DOM method that binds it to the mousemove event and declares the event handler. Most event can be bound to a handler this way.
0 140 posted 5 years ago by COBOLdinosaur
Get your screen resolution use JavaScript
0 103 posted 5 years ago by BebenKoben
The new updated introduced auto scrolling to highlighted elements, possibility to hide 'next' and 'skip' buttons, add html markup in description, and more.
0 241 posted 5 years ago by lanagio
https://www.chrisjmendez.com/2015/01/22/js-turn-image-into-vector-art-silhouette/
0 192 posted 5 years ago by chrisaiv
This step-by-step tutorial describes how to build an HTML5-based mobile web app by means of Webix library (open source, GPL) and PhoneGap framework. As a result you’ll get an awesome native app for Android devices with rich UI and high performance.
0 243 posted 5 years ago by kengajunior
With publicly available information and a little math it is possible to not only validate a given card number, but to determine the financial institution that issued the card, the type of industry the issuer belongs to, the actual account number and...
0 207 posted 5 years ago by geneticcode
https://www.chrisjmendez.com/2014/11/27/js-proper-global-variables/
0 109 posted 5 years ago by chrisaiv
List of websites I should follow to keep an eye on Javascript development.
0 108 posted 5 years ago by bboydflo
#bxSlider Prevent bxSlider stop auto slides transition, when navigating through slides.
0 201 posted 6 years ago by flexyournoggin
This snippet allows to know the parent function caller name of any level from the calling function.
1 105 posted 6 years ago by zandor
Uses javascript to create a hidden iframe which downloads the file
0 488 posted 6 years ago by jakob101
A template for a javascript object with a object.create shiv to condense into object prototypes
0 135 posted 6 years ago by rickygri
Populating Table from Inline Json Data in Angular js
0 173 posted 6 years ago by bitsofcodec
This example of code allows you to create a new object in javascript (using simple inheritance) such that the class of the object is defined from a variable. After creating the object you may use it for your purposes.
0 139 posted 6 years ago by apphp-snippets
This script will grab the YouTube video ID using regex so that many different types of YouTube urls. This will also output the id and thumbnail to view.
0 209 posted 6 years ago by astralis
« Prev 1 2 3 4 5 ... 34