How do we get query string values in JavaScript?

You don’t need jQuery for that purpose. You can use just some pure JavaScript: function getParameterByName(name) { name = name.replace(/[\[]/, “\\[“).replace(/[\]]/, “\\]”); var regex = new RegExp(“[\\?&]” + name + “=([^&#]*)”), results = regex.exec(location.search); return results == null ? “” : decodeURIComponent(results[1].replace(/\+/g, ” “)); } Usage: var prodId = getParameterByName(‘prodId’);

How do we redirect the user from one page to another using jQuery?

jQuery is not necessary, and window.location.replace(…) will best simulate an HTTP redirect. It is better than using window.location.href =, because replace() does not put the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco. If you want to simulate someone clicking on… Continue reading

What is Client-Side Programming

At the same time that server-side web development was moving through an alphabet soup of technologies, a new type of programming was gaining popularity. Developers began to experiment with the different ways they could enhance web pages by embedding miniature applets built with JavaScript, ActiveX, Java, and Flash into web… Continue reading

Explain jQuery Selectors

Selectors are the strings you pass to the jQuery function to select elements in the DOM. Example: $(function () { $(“#album-list img”).mouseover(function () { $(this).animate({ height: ‘+=25’, width: ‘+=25’ }) .animate({ height: ‘-=25’, width: ‘-=25’ }); }); }); In this example, we used “#album-list img” as a selector to find… Continue reading