Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



« Prev 1 2 3 4 5 ... 47
  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

    Add IE interenet explorer class name to body

    Use it to detect old browser, when your client still use an old browser!
    jQuery 5 views posted 2 years ago by ginoplusio
  4. 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
  5. 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
  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

    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
  8. 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
  9. 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
  10. FAV

    RegExp to find JS & Angular non-comment logs

    Regular Expression to find native Javascript console and AngularJS $log log warn or info that are NOT comments / commented out
    Regular Expression saved by 5 people 7 views posted 4 years ago by brandonjp
  11. 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
  12. 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
  13. 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
  14. FAV

    Shorthand for Ternary Operator in PHP

    Shorthand for Ternary Operator in PHP
    PHP saved by 3 people 4 views posted 4 years ago by ursdeep
  15. 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 3 people 2 views posted 4 years ago by ursdeep
  16. 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
  17. FAV

    Javascript Screen Resolutions

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

    simple custom checkboxes

    This is a simple way to make custom checkboxes in jQuery.
    jQuery 5 views posted 4 years ago by del4y
  19. 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
  20. 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
  21. 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
  22. FAV

    Check if an Enter Key Is Pressed With jQuery

    To check if an “enter” key is pressed inside a textbox, just bind the keypress() to the textbox.
    jQuery 4 views posted 5 years ago by luhonghai
  23. FAV

    Detect Copy, Paste and Cut Behavior With jQuery

    To detect copy, paste and cut behavior, you just need to bind the corresponding event type.
    jQuery 8 views posted 5 years ago by luhonghai
  24. FAV

    Check if jQuery library is loaded

    To check if jQuery library is loaded, use the following JavaScript code
    jQuery 4 views posted 5 years ago by luhonghai
  25. FAV

    Page Loading Effects With jQuery

    JQuery is really a powerful and handy JavaScript library. The page or content loading effect is very easy to implement in jQuery. Here’s a example to make your web page content display a fade in page loading effect
    jQuery 2 views posted 5 years ago by luhonghai
  26. FAV

    jQuery alle Checkboxen eines Formulars markieren - Variante 1

    Bei dieser Variante lassen sich die Checkboxen nur einmal aktivieren/deaktivieren. Bei weiteren Versuchen wird zwar im Quelltext altiviert/deaktiviert, es ist aber auf der Seite nicht zu sehen.
    jQuery 4 views posted 5 years ago by ulfinger
  27. FAV

    jQuery hook for separation of concerns

    The purpose of this hook method is to help provide a separation of concerns between CSS and JavaScript. Typically class names are used to attach JavaScript to HTML elements. Using a separate data-hook attribute helps to protect the scripting from...
    jQuery 6 views posted 5 years ago by pmw57
  28. FAV

    jQuery UI autocomplete mit JSON und externer php-Seite als Quelle

    Bei Autocomplete aus größeren Datenbanken ist es sinnvoll, die Datenbankabfrage in eine separate php-Datei zu verlegen.
    PHP 5 views posted 5 years ago by ulfinger
  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 ... 47