Welcome To Snipplr
Everyone's Recent JavaScript Snippets Tagged javascript
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
<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
14112
posted 4 years ago by antonykidless
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
11919
posted 4 years ago by priyagchaudhary
JavaScript regex for validating IP addresses, has been tested!
0
1101
posted 6 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
1160
posted 7 years ago by apphp-snippets
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
1212
posted 7 years ago by heathbo
ResponsiveBootstrapToolkit : https://github.com/maciej-gurban/responsive-bootstrap-toolkit
0
1024
posted 8 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
1528
posted 8 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
1045
posted 8 years ago by heathbo
When creating a new https://codepad.co/ snippet, the default language will be set to 'JavaScript'.
0
1008
posted 8 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
1060
posted 9 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
1071
posted 9 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
1191
posted 9 years ago by BrentS
delete Operator don’t impact the length of Array in JavaScript
1
1095
posted 9 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
996
posted 9 years ago by COBOLdinosaur
The new updated introduced auto scrolling to highlighted elements, possibility to hide 'next' and 'skip' buttons, add html markup in description, and more.
0
1379
posted 9 years ago by lanagio
https://www.chrisjmendez.com/2015/01/22/js-turn-image-into-vector-art-silhouette/
0
1344
posted 9 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
1277
posted 9 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
1249
posted 9 years ago by geneticcode
https://www.chrisjmendez.com/2014/11/27/js-proper-global-variables/
0
783
posted 9 years ago by chrisaiv
List of websites I should follow to keep an eye on Javascript development.
0
709
posted 10 years ago by bboydflo
#bxSlider
Prevent bxSlider stop auto slides transition, when navigating through slides.
0
902
posted 10 years ago by flexyournoggin
This snippet allows to know the parent function caller name of any level from the calling function.
1
816
posted 10 years ago by zandor
Uses javascript to create a hidden iframe which downloads the file
0
2685
posted 10 years ago by jakob101
A template for a javascript object with a object.create shiv to condense into object prototypes
0
919
posted 10 years ago by rickygri
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
883
posted 10 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
1111
posted 10 years ago by astralis