JavaScript Errors – Solutions

Differentiate declaration syntax: function fn() {} vs var fn = function() {} in JavaScript

javascript solutions

In the post i discuss why programmers use of function fn() {} and var fn = function() {} in JavaScript?  What is difference between these two functions and pros & cons of using the functions. The problem you face when you reuse or optimize the code of another developer, you get confuse why he used function fn() {} in one ...

Read More »

How to Check a Element is Hidden or Not in jQuery

javascript solutions

Various jQuery programmers search on the Google that it is possible to check if an element is hidden in jQuery/JavaScript. There are two predefined functions are available in jQuery by using it you can easily check the element is hidden or not in jQuery. Here is a simple code to do that. Use hidden selector to check hidden elements in ...

Read More »

Why people “use strict” in JavaScript Code and What is main Reason behind it?

javascript solutions

Many programmers and developers have problem whenever they run a JavaScript code, normally the error is: Problem at line 22 character 1: Missing “use strict” statement. This is because some programmers do not use “use strict” in the code which causes the error. you can also add “use strict” if you face the same problem while running the code. Why ...

Read More »

Check a String Contains Another Sub-String in JavaScript

javascript solutions

Hi readers hope you all will be fine, today in this post i show you how you can check a string contains another sub-string in JavaScript. I describe an easy to do that task.  String.indexof is a JavaScript function which find and return the position of string with in the string. and when you run the code result is True. ...

Read More »

How to Redirect to another Page using jQuery – Undertand jQuery Redirection.

javascript solutions

In this post i will show you a various methods and examples to redirect user to another page or URL by using jQuery. It is better to use window.location.replace() instead of window.location.href() because the function do not store the redirected page in the browser history and session. window.location.href() function works on every browser. For Example. If you can do without ...

Read More »

How JavaScript Closure Work? Explain with Examples

javascript solutions

This post will explain you the concept of closures in JavaScript. Programmer better understand the concept of closures after read this post, that it is not difficult and conceptual. Closures help JavaScript programmer to write organize code, no matter you are hard core JavaScript programmer, you can easily use it again and again. I again say that closures are much ...

Read More »