Click here to Skip to main content
11,581,982 members (77,015 online)
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 2: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

  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 330
1 Sergey Alexandrovich Kryukov 165
2 virusstorm 109
3 Frankie-C 105
4 F-ES Sitecore 85
0 OriginalGriff 1,273
1 Sergey Alexandrovich Kryukov 900
2 Abhinav S 617
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 19 Aug 2013
Copyright © CodeProject, 1999-2015
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