Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
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 3:30am
moon20111.1K
Comments
armagedescu at 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...Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

pl check the following link for different options:
 
http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript[^]
  Permalink  
Comments
moon2011 at 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
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 295
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 19 Aug 2013
Copyright © CodeProject, 1999-2014
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