Welcome To Snipplr

Everyone's Recent JavaScript Snippets Tagged javascript

« Prev 1 2 3 4 5 ... 33
<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 10568 posted 3 years ago by antonykidless
This code is used to get the unique values of an array.
0 9829 posted 3 years 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 9084 posted 3 years ago by priyagchaudhary
JavaScript regex for validating IP addresses, has been tested!
0 740 posted 5 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 766 posted 6 years ago by apphp-snippets
A one-liner that converts a decimal number to a binary number
0 749 posted 6 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 817 posted 6 years ago by heathbo
ResponsiveBootstrapToolkit : https://github.com/maciej-gurban/responsive-bootstrap-toolkit
0 716 posted 7 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 1094 posted 7 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 715 posted 7 years ago by heathbo
When creating a new https://codepad.co/ snippet, the default language will be set to 'JavaScript'.
0 691 posted 7 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 696 posted 7 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 710 posted 7 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 822 posted 8 years ago by BrentS
delete Operator don’t impact the length of Array in JavaScript
1 716 posted 8 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 672 posted 8 years ago by COBOLdinosaur
Get your screen resolution use JavaScript
0 527 posted 8 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 989 posted 8 years ago by lanagio
0 973 posted 8 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 916 posted 8 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 870 posted 8 years ago by geneticcode
0 505 posted 8 years ago by chrisaiv
List of websites I should follow to keep an eye on Javascript development.
0 490 posted 8 years ago by bboydflo
#bxSlider Prevent bxSlider stop auto slides transition, when navigating through slides.
0 621 posted 9 years ago by flexyournoggin
This snippet allows to know the parent function caller name of any level from the calling function.
1 515 posted 9 years ago by zandor
Uses javascript to create a hidden iframe which downloads the file
0 2271 posted 9 years ago by jakob101
A template for a javascript object with a object.create shiv to condense into object prototypes
0 621 posted 9 years ago by rickygri
Populating Table from Inline Json Data in Angular js
0 734 posted 9 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 595 posted 9 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 833 posted 9 years ago by astralis
« Prev 1 2 3 4 5 ... 33