473,499 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variable in window.location

how to get variables and their values from window location ...
example:
http://www.site.com?variable1=value1&variable2=value2
Aug 22 '05 #1
1 1613
Marko wrote:
how to get variables and their values from window location ...
example:
http://www.site.com?variable1=value1&variable2=value2


function get(){
var x=location.search.substring(1).split("&")
for(var i=0;i<x.length;i++){
var y=x[i].split("=");
window[y[0]]=y[1];
}
alert(variable1);alert(variable2);
}
Mick
Aug 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
72107
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function...
1
7582
by: Dany P. Wu | last post by:
Hi everyone, I've finally figured out what I actually want to do with my website, let's hope this time I can explain it better. The opening page of the website has a bunch of links that look...
9
7738
by: Bryan Ashby | last post by:
All, I'm looking for a way to define a "dummy" variable in JavaScript; specifically for the window object. I would like to define a window object that would normally be generated with...
7
15898
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
4
13063
by: R45six | last post by:
Really can't figure this out, would appreciate some help... Have a textbox in a form which user types in a url link. When they click a button I'd like it to open a new window, and attempt to...
5
2151
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
1
5658
by: stephane | last post by:
I have a problem which must be in this : print" <script type='text/javascript'> document.location.replace('http://127.0.0.1/add_task.php?req_id={$maxValue}&tk_request_name={$req_name}');...
0
1529
by: Mirovk | last post by:
Hello Agn, 1.- Being at the a.asp I refresh the page and session variables using a JavaScript function: { simbolo = window.document.frmdir.simbolo.value;...
1
25617
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
1
3869
by: faultykid | last post by:
I would like to store a variable then call it back later. I have a variable on line 198 www = ''+this._ad.clickUrl+''; and on line 321 i try document.write(www);
0
7009
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
7390
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
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.