OneLib

Log in
  • Register
  • Lost password
  • Activity
  • Snippets
  • My Library
  • Members
  • Groups

What is OneLib?

Welcome to OneLib!

OneLib is a JavaScript snippet library that is driven by quality and user ratings. Users can upvote or downvote snippets, meaning that the best code is available for your website!

Simply find Snippets that are perfect for your website and add them to your Library. You can then download your own copy, or link directly to your OneLib library from your website.

Log in

  • Register
  • Lost password

Groups

  • New Group Requests

    New Group Requests

    New group requests
  • Introductions

    Introductions

    Introductions

Newest Members

    • Kyle

    All Site Activity

      • Kyle
        Kyle created the group New Group Requests 260 days ago
        Due to a large amount of spam, I have decided to stop users from creating their own groups. If you would like a new group to be created, either message Kyle, or post a request in this group. When asking for a new group, please provide the...
        • Kyle
          Kyle created the group Introductions 260 days ago
          Hello, and welcome to OneLib!  New users, feel free to say hi here, and tell us a little bit about yourselves :) Kyle
          • Kyle
            Kyle added a new snippet: Get absolute URL 287 days ago

            Taken from https://davidwalsh.name/essential-javascript-functions

            "Getting an absolute URL from a variable string isn't as easy as you think. There's the URL constructor but it can act up if you don't provide the required arguments (which sometimes you can't). Here's a suave trick for getting an absolute URL from any string input... The "burn" element href handles any URL nonsense for you, providing a reliable absolute URL in return."

            • Kyle
              Kyle updated a snippet: Run once 287 days ago

              Taken from https://davidwalsh.name/essential-javascript-functions

              "There are times when you prefer a given functionality only happen once, similar to the way you'd use an onload event... ...The once function ensures a given function can only be called once, thus preventing duplicate initialization!"

              • Kyle
                Kyle added a new snippet: Run once 287 days ago

                Taken from https://davidwalsh.name/essential-javascript-functions

                "There are times when you prefer a given functionality only happen once, similar to the way you'd use an onload event... ...The once function ensures a given function can only be called once, thus preventing duplicate initialization!"

                • Kyle
                  Kyle updated a snippet: Cookies 287 days ago

                  Taken from https://www.webhostingsecretrevealed.net/blog/featured-articles/15-cool-javascript-sample-snippets/

                  "This snippet is a little long but very useful, it will allow your site to store information on the viewer’s computer then read it at another point in time. This snippet can be used in many different ways to accomplish different tasks."

                  • Kyle
                    Kyle updated a snippet: $id() - Shortened document.getElementById() 287 days ago

                    Taken from https://websemantics.uk/archived/useful-javascript-functions/

                    "Saves repeatedly writing out document.getElementById('id'). Results are cached which speeds up repeat requests by 50%."

                    I really like this one, credit to Mike Foskett @ websemantics.uk! 

                    • Kyle
                      Kyle updated a snippet: Polling 287 days ago

                      Taken from https://davidwalsh.name/essential-javascript-functions

                      "...sometimes you don't get to plug into an event to signify a desired state -- if the event doesn't exist, you need to check for your desired state at intervals. Polling has long been useful on the web and will continue to be in the future!"

                      • Kyle
                        Kyle updated a snippet: Debounce 287 days ago

                        Taken from https://davidwalsh.name/essential-javascript-functions

                        "The debounce function can be a game-changer when it comes to event-fueled performance. If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. Here's a debounce function to keep your code efficient. The debounce function will not allow a callback to be used more than once per given time frame. This is especially important when assigning a callback function to frequently-firing events."

                        • Kyle
                          Kyle updated a snippet: Cookies 287 days ago

                          Taken from https://www.webhostingsecretrevealed.net/blog/featured-articles/15-cool-javascript-sample-snippets/

                          "This snippet is a little long but very useful, it will allow your site to store information on the viewer’s computer then read it at another point in time. This snippet can be used in many different ways to accomplish different tasks."

                          • Kyle
                            Kyle updated a snippet: $id() - Shortened document.getElementById() 287 days ago

                            Taken from https://websemantics.uk/archived/useful-javascript-functions/

                            "Saves repeatedly writing out document.getElementById('id'). Results are cached which speeds up repeat requests by 50%."

                            I really like this one, credit to Mike Foskett @ websemantics.uk! 

                            • Kyle
                              Kyle updated a snippet: Polling 287 days ago

                              Taken from https://davidwalsh.name/essential-javascript-functions

                              "...sometimes you don't get to plug into an event to signify a desired state -- if the event doesn't exist, you need to check for your desired state at intervals. Polling has long been useful on the web and will continue to be in the future!"

                              • Kyle
                                Kyle updated a snippet: Debounce 287 days ago

                                Taken from https://davidwalsh.name/essential-javascript-functions

                                "The debounce function can be a game-changer when it comes to event-fueled performance. If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. Here's a debounce function to keep your code efficient. The debounce function will not allow a callback to be used more than once per given time frame. This is especially important when assigning a callback function to frequently-firing events."

                                • Kyle
                                  Kyle has a new avatar 292 days ago
                                  Kyle
                                  • Kyle
                                    Kyle updated a snippet: Cookies 292 days ago

                                    Taken from https://www.webhostingsecretrevealed.net/blog/featured-articles/15-cool-javascript-sample-snippets/

                                    "This snippet is a little long but very useful, it will allow your site to store information on the viewer’s computer then read it at another point in time. This snippet can be used in many different ways to accomplish different tasks."

                                    • Kyle
                                      Kyle updated a snippet: $id() - Shortened document.getElementById() 292 days ago

                                      Taken from https://websemantics.uk/archived/useful-javascript-functions/

                                      "Saves repeatedly writing out document.getElementById('id'). Results are cached which speeds up repeat requests by 50%."

                                      I really like this one, credit to Mike Foskett @ websemantics.uk! 

                                      • Kyle
                                        Kyle updated a snippet: Polling 292 days ago

                                        Taken from https://davidwalsh.name/essential-javascript-functions

                                        "...sometimes you don't get to plug into an event to signify a desired state -- if the event doesn't exist, you need to check for your desired state at intervals. Polling has long been useful on the web and will continue to be in the future!"

                                        • Kyle
                                          Kyle updated a snippet: Debounce 292 days ago

                                          Taken from https://davidwalsh.name/essential-javascript-functions

                                          "The debounce function can be a game-changer when it comes to event-fueled performance. If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. Here's a debounce function to keep your code efficient. The debounce function will not allow a callback to be used more than once per given time frame. This is especially important when assigning a callback function to frequently-firing events."

                                          • Kyle
                                            Kyle added a new snippet: Debounce 292 days ago

                                            Taken from https://davidwalsh.name/essential-javascript-functions

                                            "The debounce function can be a game-changer when it comes to event-fueled performance. If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. Here's a debounce function to keep your code efficient. The debounce function will not allow a callback to be used more than once per given time frame. This is especially important when assigning a callback function to frequently-firing events."

                                            • Kyle
                                              Kyle added a new snippet: Polling 292 days ago

                                              Taken from https://davidwalsh.name/essential-javascript-functions

                                              "...sometimes you don't get to plug into an event to signify a desired state -- if the event doesn't exist, you need to check for your desired state at intervals. Polling has long been useful on the web and will continue to be in the future!"

                                            • Previous
                                            • 1
                                            • 2
                                            • Next
                                            • About
                                            • Terms
                                            • Privacy
                                            • Powered by Elgg