Either newbie or experienced developer, everyone occasionally stuck with a situation that it’s event binding runs in a loop or multiple times and it runs unexpected and we are unable to find the bug because we bind the event only one time but in practical it binds so multiple times.
Author » K K Agrawal
event.preventDefault() vs. return false
event.preventDefault() vs. return false is a very important but confusing topic that which one should be used and for what. When we want to prevent other event handlers from executing after a certain event is fired, we can use one of these two techniques
Getting query string values in javascript
Sometimes we get the important data through query string but question is of getting query string values in javascript or jquery because we need these values at client side. Even we can do it by using only javascript also.
Return the response from AJAX call – the right way to do
AJAX is common now a days. People try to implement AJAX but fail to return the response from AJAX call successfully because they misunderstood the concept behind AJAX and the right way to do that.
Here I have tried to explain the flow and restructure the code for AJAX to let your application work. First I have explained the problem then the meaning of AJAX and flow as well followed by the solution.
Array in JavaScript – push() Method
Array in JavaScript push() method appends the given element or elements in the last of array. It returns the length of the new array.
Syntax is as below:
array.push(item1, item2,.....itemN);
Open popup from another popup in jQuery
I had popup working and I wanted to open popup from another popup where a link was placed inside first popup using jQuery. This kind of scenario is quite common.
Most probable example we see are login and register popup boxes where one can toggle to login/register popup box through a link given in currently opened popup.
Array in JavaScript – unshift() Method
Array unshift() method adds one or more elements to the beginning of an existing array and returns the new length of the array in Javascript.
Array in javascript
Array is most important keyword used in programming languages. Like other languages, Array is also used in javascript. Array in JavaScript is used to store multiple values in a single variable. Arrays in javascript is as special type of object
update div top position based on its changing height
Few days ago, I have a requirement to update Div top position based on its changing height. I tried to resolve it by using different way
multiple instances of flexslider on a single page
I was developing a website. In that, I wanted to use multiple instances of flexslider on a single page. There was not the problem if ID of the container tags is different. But on my website, everything was dynamic, even how many flexslider instances were be called, that was also unknown