aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Get QueryString Value | Get QueryString Parameter Values in jQuery

Feb 3, 2013

Here I will explain how to get query string parameter values using jQuery or get query string variable values using jQuery in

In previous articles I explained
jQuery get current page url and title, jQuery change textbox background color on focus, jQuery Enable or disable textbox controls, jQuery create rounded corners for textbox, and many articles relating to JavaScript, jQuery, Now I will explain how to get query string parameter values using jQuery in

To implement this we need to write the code like as shown below

<html xmlns="">
<title>jQuery Get Current Page Url Parameter values</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function () {
var name = GetParameterValues('username');
var id = GetParameterValues('userid');
$('#spn_UserName').html('<strong>' + name + '</strong>');
$('#spn_UserId').html('<strong>' + id + '</strong>');
function GetParameterValues(param) {
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < url.length; i++) {
var urlparam = url[i].split('=');
if (urlparam[0] == param) {
return urlparam[1];
<form id="form1" runat="server">
<p>UserName: <span id="spn_UserName"></span></p>
<p>UserId: <span id="spn_UserId"></span></p>

To check above example I given ur like “” and it return values like as shown below 

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Unknown said...

how can i add data pager in data list

Anonymous said...

sir can u please post the article for upload video and play in browser !!

Unknown said...


Chetna said...

Hello Sir,
i am facing a problem when i was calling a Webservice using JQuery AJax (With Input)
The Error is 500 internal server error.
Please help me
Thnx in Advance

Anonymous said...

Thanks.. Its Working.

Unknown said...
This comment has been removed by the author.
Anonymous said...

This is NOT JQuery. Your solution is simply JavaScript.
You need to research and understand what JQuery really is.

Unpublished Guy said...

Well, whether it is or isn't jquery it really worked for me and was the simplest solution I could find on the Interwebs.

Anonymous said...

Hi Chetna,
500 error means you have some error in the function you call using ajax. you should check you method and you will found some error there.

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.