reload a page with argument

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ike

    #1

    reload a page with argument

    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)


  • kaeli

    #2
    Re: reload a page with argument

    In article <YqeLb.16277$6B .13312@newsread 1.news.atl.eart hlink.net>,
    rxv@hotmail.com enlightened us with...[color=blue]
    > 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)
    >[/color]

    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.



    Comment

    • Lee

      #3
      Re: reload a page with argument

      Ike said:[color=blue]
      >
      >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)[/color]

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

      window.location ="123bottom.htm l?ans=Ike".

      Comment

      • Ike

        #4
        Re: reload a page with argument

        Yes! This is it perfectly. Thank you! Ike

        "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
        news:MPG.1a6740 11665a476989a8f @nntp.lucent.co m...[color=blue]
        > In article <YqeLb.16277$6B .13312@newsread 1.news.atl.eart hlink.net>,
        > rxv@hotmail.com enlightened us with...[color=green]
        > > Suppose I have a frame like 123bottom.html and within it, I want to[/color][/color]
        promt[color=blue][color=green]
        > > 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)
        > >[/color]
        >
        > 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
        >[/color]


        Comment

        Working...