470,632 Members | 2,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,632 developers. It's quick & easy.

reload a page with argument

Ike
Suppose I have a frame like 123bottom.html and within it, I want to promt
the user for a response (in the <HEAD>) like

var ans = prompt("What is your name?");

and then reload the page (via, say window.location.reload() ?)

using the argument of the value of ans appended onto the url so that, in
effect, say, I am calling the new frame as

123bottom.html?ans=Ike

Can someone show me how I need to call the page again, itself, like this
once I have the value for ans? Thanks, Ike (himself)
Jul 20 '05 #1
3 2257
In article <Yq******************@newsread1.news.atl.earthlink .net>,
rx*@hotmail.com enlightened us with...
Suppose I have a frame like 123bottom.html and within it, I want to promt
the user for a response (in the <HEAD>) like

var ans = prompt("What is your name?");

and then reload the page (via, say window.location.reload() ?)

using the argument of the value of ans appended onto the url so that, in
effect, say, I am calling the new frame as

123bottom.html?ans=Ike

Can someone show me how I need to call the page again, itself, like this
once I have the value for ans? Thanks, Ike (himself)


in BODY, not head

<form name="f1">
<input type="hidden" name="ans">
</form>

<script type="text/javascript">
var a = prompt("What is your name?");
document.forms["f1"].elements["ans"].value=a;
document.forms["f1"].elements["ans"].submit();
</script>

Default action of a form is to submit with GET (url) to same page,
resulting in a "reload" with the url appended with ans=whatever

--
--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
Lee
Ike said:

Suppose I have a frame like 123bottom.html and within it, I want to promt
the user for a response (in the <HEAD>) like

var ans = prompt("What is your name?");

and then reload the page (via, say window.location.reload() ?)

using the argument of the value of ans appended onto the url so that, in
effect, say, I am calling the new frame as

123bottom.html?ans=Ike

Can someone show me how I need to call the page again, itself, like this
once I have the value for ans? Thanks, Ike (himself)


If you're changing anything, you're not actually a reloading it,
you're changing the location:

window.location="123bottom.html?ans=Ike".

Jul 20 '05 #3
Ike
Yes! This is it perfectly. Thank you! Ike

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP***********************@nntp.lucent.com...
In article <Yq******************@newsread1.news.atl.earthlink .net>,
rx*@hotmail.com enlightened us with...
Suppose I have a frame like 123bottom.html and within it, I want to promt the user for a response (in the <HEAD>) like

var ans = prompt("What is your name?");

and then reload the page (via, say window.location.reload() ?)

using the argument of the value of ans appended onto the url so that, in
effect, say, I am calling the new frame as

123bottom.html?ans=Ike

Can someone show me how I need to call the page again, itself, like this
once I have the value for ans? Thanks, Ike (himself)


in BODY, not head

<form name="f1">
<input type="hidden" name="ans">
</form>

<script type="text/javascript">
var a = prompt("What is your name?");
document.forms["f1"].elements["ans"].value=a;
document.forms["f1"].elements["ans"].submit();
</script>

Default action of a form is to submit with GET (url) to same page,
resulting in a "reload" with the url appended with ans=whatever

--
--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

66 posts views Thread by Ellinghaus, Lance | last post: by
19 posts views Thread by Darren | last post: by
3 posts views Thread by John Salerno | last post: by
5 posts views Thread by Josh Nikle | last post: by
2 posts views Thread by Max | last post: by
14 posts views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.