What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-21 09:01:04
how to implement passwordless SMS
<button id="signin-sms">Login</button> <script src="//cdn.auth0.com/js/lock-passwordless-1.0.min.js"></script> <script type="text/javascript"> document.getElementById('signin-sms').o... Add solution -
Javascript 2021-10-20 21:36:04
javascript base64 encode file input
var fileInput = document.getElementById('#myInputID'); var reader = new FileReader(); reader.readAsDataURL(fileInput.files[0]); reader.onload = function () { console.log(reader.result);//base64encoded string }; reader.onerror = function (error) { cons... Add solution -
Javascript 2021-10-19 08:43:10
inheritance in javascript
function Animal (name, energy) { this.name = name this.energy = energy } Animal.prototype.eat = function (amount) { console.log(`${this.name} is eating.`) this.energy += amount } Animal.prototype.sleep = function (length) { console.log(`${this... Add solution -
Javascript 2021-10-17 06:55:06
javascript generate unique id
var ID = function () { // Math.random should be unique because of its seeding algorithm. // Convert it to base 36 (numbers + letters), and grab the first 9 characters // after the decimal. return '_' + Math.random().toString(36).substr(2, 9); }; Add solution -
Javascript 2021-10-11 21:00:03
javascript string prototype
/* String prototype all built-in methods: * developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String * ------------------------------------------------------------------------- */ // Example for *extending* the String prototype String... Add solution -
Javascript 2021-10-11 08:05:19
Authentication handling in javascript
var token_ // variable will store the token var userName = "clientID"; // app clientID var passWord = "secretKey"; // app clientSecret var caspioTokenUrl = "https://xxx123.caspio.com/oauth/token"; // Your application token en... Add solution -
Javascript 2021-10-10 00:11:05
prototype inheritance javascript
function Animal (name, energy) { this.name = name this.energy = energy } Animal.prototype.eat = function (amount) { console.log(`${this.name} is eating.`) this.energy += amount } Animal.prototype.sleep = function (length) { console.log(`${this... Add solution
Best helpers
Ranking is empty