473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

QueryString in JavaScript

Hi friends,

I am sending a QueryString from ServerSide
Response.Redirect("Iframe.aspx?var1=" & Hidden1.Value)

I want to recieve this QueryString value in clientside variable of javascript

Please help me how to do this.

Thanks and Regards
Saurabh Pant
Sep 29 '07 #1
2 1605
ak1dnar
1,584 Expert 1GB
Heya check this out:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="JavaScript" type="text/javascript">
  4. function getURLvalues() 
  5. {
  6. // We'll Try this URL for the Script
  7. //http://www.thescripts.com/forum/Iframe.aspx?var1=1001
  8.     var fullURL = window.document.URL.toString();
  9.  
  10.     if (fullURL.indexOf("?") > 0){
  11.     var SplitURL = fullURL.split("?");
  12.     var param = SplitURL[1].split("=");
  13.     alert(param[1]) // This will print "1001"
  14.     }
  15. // If the URL is something like this: Please don't call me :D
  16. //http://www.thescripts.com/forum/Iframe.aspx?var1=1001&var2=1002...
  17.  
  18. }
  19. </script>
  20. </head>
  21.  
  22. <body onload="getURLvalues()">
  23. </body>
  24. </html>
Sep 29 '07 #2
Heya check this out:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="JavaScript" type="text/javascript">
  4. function getURLvalues() 
  5. {
  6. // We'll Try this URL for the Script
  7. //http://www.thescripts.com/forum/Iframe.aspx?var1=1001
  8.     var fullURL = window.document.URL.toString();
  9.  
  10.     if (fullURL.indexOf("?") > 0){
  11.     var SplitURL = fullURL.split("?");
  12.     var param = SplitURL[1].split("=");
  13.     alert(param[1]) // This will print "1001"
  14.     }
  15. // If the URL is something like this: Please don't call me :D
  16. //http://www.thescripts.com/forum/Iframe.aspx?var1=1001&var2=1002...
  17.  
  18. }
  19. </script>
  20. </head>
  21.  
  22. <body onload="getURLvalues()">
  23. </body>
  24. </html>
Thanks Dear.
It's working.

Regards
Saurabh Pant
Oct 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%=...
1
by: Fastly | last post by:
Hi Guys I'm no Javascript guru, although am fairly confidant using PHP... What I have knocked together here uses PHP to create a querystring without the iso=XX value, and dump it's output within...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
7
by: Utter Newbie | last post by:
Just wondeing if there is a way to keep from having a certain parameter sent when posting a form to another page (method=get)... So as an example a page will post something like this from a form...
0
by: Matt Howeson | last post by:
Some time ago I posted a request for help with a problem I was having sometime ago whereby a 404 error would result if any access to the Querystring had been made before the Context.Rewritepath is...
2
by: Amadelle | last post by:
Hi all, I have multiple frames which I would like to get the query string from within one of the subframes. But when I do HttpContext.Current.Request.QueryString or Request.QueryString ...
12
by: Manso | last post by:
Hi, Our sites need to support utf-8 so web.config has both request and response encoding set to utf-8. The problem is that Request.Querystring doesn't support this and we've tried to find a...
9
by: VancouverMike | last post by:
Hi there, I run into a very strange problem. I got the following url and am passing information via query string. The problem when the "sin" key in query string is blank, shown as in the...
7
by: fox | last post by:
Hi, Lacking javascript knowledge, I just realized why my project has a bug. I am using ASP to loop through a set of records while it creates URLs with a querystring that has a single value pair....
2
by: jp2express | last post by:
Does Request.QueryString need to be carried out using ASP, or can JavaScript handle this? I know it is simple, but I've never done it and I don't know what to search for. Say I wanted my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.