Admin
Apr 09, 2020
17 comments
1.03K
In JavaScript, you can use following two ways to get hidden field value in a form : document.getElementById(‘hidden field id’).value document.formName.elements[‘hidden field name’].value See an example here… function printIt(){ ...
Snippet
Pass value from JSP to Javascript
Admin
Mar 02, 2018
24 comments
1.18K
What is the Singleton design pattern?   The Singleton design pattern is a creational pattern that states that one and only one instance of a class would persist in the memory during the application's life cycle. In other words, this design patte...
Tutorial
Implementing the Singleton Design Pattern in JavaScript
Admin
Feb 27, 2017
17 comments
364
  A workaround for ng-change in angular js which does not catch file input change event.   view.html: <input type="file" custom-on-change="uploadFile"> controller.js: app.controller('myCtrl', function($scope){ $scope.uploadFile = func...
Snippet
File change event using custom angular directive
Admin
Jan 25, 2017
5 comments
437
JavaScript is the official language of all modern web browsers. As such, JavaScript questions come up in all sorts of developer interviews. This article isn’t about the newest JavaScript libraries, common development practices, or any of the new ...
Snippet
3 JavaScript questions for coding interviews
Admin
Dec 01, 2016
10 comments
814
Here’s the list of the top 10 best ES6 features for a busy software engineer (in no particular order): Default Parameters in ES6 Template Literals in ES6 Multi-line Strings in ES6 Destructuring Assignment in ES6 Enhanced Object Literals in ...
Snippet
MUST READ: Top 10 ES6 Features
Admin
Sep 02, 2016
5 comments
1.18K
The solution doesn’t require writing a specific directive or adding any additional attributes or decoration to my page content -  a short timeout (like, 1ms short) inside of which Prism.highlightElement(elem) is called. // Content is my service, ...
Snippet
Using PrismJs syntax highlighting with AngularJs
Admin
May 09, 2016
0 comments
1.08K
JavaScript can be a nightmare to debug: Some errors it gives can be very difficult to understand at first, and the line numbers given aren’t always helpful either. Wouldn’t it be useful to have a list where you could look to find out what they m...
Snippet
Common JavaScript Errors and How to Fix Them
Admin
Apr 04, 2016
10 comments
1.09K
The solution is to keep count of the number of times the function is called to execute AJAX request and on failed requests recall the function. The retryLimit can be modified to the number to times the AJAX function is called. function callback()...
Snippet
Retry failed AJAX request
Admin
Apr 01, 2016
18 comments
519
To run server.js, the socket.io file Install nodejs globally. install npm globally go to your project folder and install npm modules npm install connect npm install socket.io Make sure the port your're using is open in the iptables, if not...
Snippet
Configuring Socket IO on server