Click here to Skip to main content
12,956,278 members (58,647 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
hii all
i have asp.net page which passes a querystring to another page.
i want to check about that querystring but in javasript.

$(document).ready.

Any Suggestion......

Thanks
Posted 25-Aug-11 2:30am
moon20111.1K
Comments
armagedescu 16-Jul-12 10:39am
   
How is this related to C++?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

unction getQuerystring(key)
 
{
 

 
 key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,\\\]);
 
 var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
 
 var qs = regex.exec(window.location.href);
 
 if(qs == null)
 
alert("SOme message");
 
else alert(qs[1]);
 
}
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

Hey Dude..

You can get & extract the query string in JavaScript using the following Lines.



var qrStr = window.location.search;
    qrStr = qrStr.split("?")[1].split("=")[1];



Hope this
will help...:)
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
moon2011 25-Aug-11 8:39am
   
thanks, but i saw it before and i couldn't get it. :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Get_Query_String_Using_Javascript[^]

JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript[^]

I got about 1.35 million results by using "Javascript Querystring" as a search term in google.
Check them out[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

I found a very clear/simple and working solution.

Go through the link below -
accessing querystring through javascript
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

You cold refer this article, which provides the solution: Easy Manipulation of URL in JavaScript[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,243
ppolymorphe 2,070
Jochen Arndt 1,973


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 19 Aug 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100