Welcome To Snipplr


Everyone's Recent JavaScript Snippets



« Prev 1 2 3 4 5 ... 67
  1. FAV

    pdf: get all fields and set to read only

    set all fields to read only in a for-loop,
    JavaScript 3 views posted 2 years ago by alexosm
  2. FAV

    Display Random Quotes with JavaScript

    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.
    JavaScript 4 views posted 2 years ago by apphp-snippets
  3. FAV

    Decimal to binary converter

    A one-liner that converts a decimal number to a binary number
    JavaScript 7 views posted 3 years ago by rm1984
  4. FAV

    React: Pass value to method from onClick

    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...
    JavaScript 2 views posted 3 years ago by heathbo
  5. FAV

    Detect the OS of mobile device

    Detect the OS of mobile device
    JavaScript 5 views posted 3 years ago by envane21
  6. FAV

    Bootstrap javascript breakpoint utils

    ResponsiveBootstrapToolkit : https://github.com/maciej-gurban/responsive-bootstrap-toolkit
    JavaScript 6 views posted 4 years ago by dhjapan
  7. FAV

    Button text on wrong answer

    change the button text on wrong answer
    JavaScript 5 views posted 4 years ago by envane21
  8. FAV

    Dynamics CRM 2011 Filter Subgrid and Refresh

    Filters a dynamics CRM 2011 subgrid...implementation example included at bottom
    JavaScript 4 views posted 4 years ago by skinnymoore
  9. FAV

    React: Get width, height, and coordinates of a react object

    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...
    JavaScript 7 views posted 4 years ago by heathbo
  10. FAV

    React: How to access returned HTML within a React Component

    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...
    JavaScript 3 views posted 4 years ago by heathbo
  11. FAV

    Codepad.co - Set Default Language to JavaScript.js Last active 11 minutes ago

    When creating a new https://codepad.co/ snippet, the default language will be set to 'JavaScript'.
    JavaScript 5 views posted 4 years ago by avansare
  12. FAV

    Anti iFrame Buster in JavaScript

    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...
    JavaScript 2 views posted 4 years ago by apphp-snippets
  13. FAV

    Getting IP Address

    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:
    JavaScript 3 views posted 4 years ago by apphp-snippets
  14. FAV

    Check if checkbox is checked

    Check if the checkbox is checked or not on button click
    JavaScript 9 views posted 4 years ago by envane21
  15. FAV

    forEach. How to break?

    Array.prototype.forEach You can't break forEach. So use "some" or "every". Array.prototype.some some is pretty much the same as forEach but it break when the callback returns true. Array.prototype.every every is almost identical to some except i...
    JavaScript 6 views posted 4 years ago by Waltem
  16. FAV

    Remove an item from array using UnderscoreJS

    Using underscore.js, you could combine .findWhere with .without Although, since you are creating a new array in this case anyway, you could simply use _.filter or the native Array.prototype.filter function (just like shown in the other question)....
    JavaScript 11 views posted 4 years ago by Balamir
  17. FAV

    JS - debug console log logger error, warn, info, log, debug

    // create a variable to toggle debugging // to use it, just call debug(with,any,optional,parameters) debug(x,y,z); // it will try to guess what type of message to log, or you can specify in the first parameter debug("error",x,y,z);
    JavaScript saved by 9 people 5 views posted 4 years ago by brandonjp
  18. FAV

    Verify email address

    Allows for forname.o'[email protected]
    JavaScript 7 views posted 4 years ago by flatearthcomms
  19. FAV

    Copy object by value instead of by reference

    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,...
    JavaScript 7 views posted 4 years ago by BrentS
  20. FAV

    delete Operator don’t impact the length of Array in JavaScript

    delete Operator don’t impact the length of Array in JavaScript
    JavaScript saved by 9 people 2 views posted 4 years ago by ursdeep
  21. FAV

    Caoturing the Mouse Position

    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.
    JavaScript 3 views posted 4 years ago by COBOLdinosaur
  22. FAV

    Javascript Screen Resolutions

    Get your screen resolution use JavaScript
    JavaScript 6 views posted 4 years ago by BebenKoben
  23. FAV

    Check if jquery was loaded from CDN

    Check if jquery was loaded from CDN. If not, load it from own website.
    JavaScript 6 views posted 5 years ago by a1ias
  24. FAV

    EnjoyHint 3.0 To Add Free Hints and Tips To Site Or App

    The new updated introduced auto scrolling to highlighted elements, possibility to hide 'next' and 'skip' buttons, add html markup in description, and more.
    JavaScript 12 views posted 5 years ago by lanagio
  25. FAV

    Google Enabler JS

    JavaScript Google Enabler. This code should be placed in all html creatives for Google DoubleClick Studio.
    JavaScript 6 views posted 5 years ago by RodolfoMiranda
  26. FAV

    NodeJS: Turn image into Vector art silhouette

    I was recently asked to turn a bitmap image (.bmp) into a vector graphic and I wanted to do it using Javascript. NodeJS did the trick with a little help from Node Package Manager and Brew Package Manager. The first step was to install potrace then i...
    JavaScript 9 views posted 5 years ago by chrisaiv
  27. FAV

    Creating a Mobile App with PhoneGap and Webix

    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.
    JavaScript 9 views posted 5 years ago by kengajunior
  28. FAV

    Hexadecimal Color Inverter

    By Matt Lagrandeur
    JavaScript 7 views posted 5 years ago by tionazo
  29. FAV

    Credit Card Parser & Validator

    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...
    JavaScript 9 views posted 5 years ago by geneticcode
  30. FAV

    Proper Global Variables

    It's not a good idea to create global variables unless you do something like this. From here, all you need to do is setData(YOUR_DATA) and getData()['key']
    JavaScript 7 views posted 5 years ago by chrisaiv
« Prev 1 2 3 4 5 ... 67