|
-
Nov 30th, 2002, 10:13 PM
#1
Thread Starter
Hyperactive Member
sending variable to a new page
what im trying to do is send a number to a page that the user opens im trying to do it in java what i have so far is:
page 1
<a href = "http://wherenewpageis.html?send=1">test send</a>
page http://wherenewpageis.html
<script language = "javascript">
document.writeln(send);
</script>
im not shure if im even doing it remotly right im just kindof guessing that the ?send=1 makes a varble on the page its loading called send and sets it to 1 but it seems thats not the case or if it is im doing something else wrong please tell me how to do it or what im doing wrong.
thanx
-
Dec 1st, 2002, 07:51 AM
#2
Frenzied Member
No it doens't make a variable on the page (unless you are using a server-side method to retrieve it rather than JavaScript). You will need to use a script to find all the arguments in the query string. I think I have one on my site at http://www.rickbull.co.uk/tutorials/...t%20Downloads/ which you can use if you like.
-
Dec 3rd, 2002, 10:07 PM
#3
Thread Starter
Hyperactive Member
thanks for the script rick.
now i have another quaestion how can you detect if they havent put any parameter in the adress
-
Dec 4th, 2002, 06:16 AM
#4
Frenzied Member
Well you could make up another function from the script I gave you. Let me do that, reupload it then I'll post back here.
-
Dec 4th, 2002, 06:42 AM
#5
Frenzied Member
OK, I've updated it http://www.rickbull.co.uk/tutorials/...t%20Downloads/ - there's now a new function hasArgument, just pass in whatever argument name you want. E.g. this will return whether the argument 'user' is present:
Code:
alert(hasArgument('user'));
-
Dec 4th, 2002, 05:41 PM
#6
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|