Redirect twice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    Redirect twice

    Hi,

    I'm wondering if this is possible...I'm using JS,struts and Java by the way...

    I've got a call that goes to a JS function, the function takes a variable called url.
    At the end of the script it does this:

    Code:
    self.location.href = url;
    What that does is redirect it to the url site, right?

    Well, I'm wondering if I can do something like this:

    Code:
    self.location.href = url;
    self.location.href = "myUrl";
    That is, redirect it twice so to say...

    JS is not my strongest skill, this may be way out there but I think it would solve somethings for me....

    Any help is appreciated.

    /MK
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    I can't really think of a situation that would require this. Any more info? Might be able to suggest something then.

    Cheers,
    Mark.

    Comment

    • rnd me
      Recognized Expert Contributor
      • Jun 2007
      • 427

      #3
      no. as soon as you leave the page, script execution stops.
      the second command would never fire.

      you could use an iframe, form, or img tag if you are trying to talk to the server.

      Comment

      • MarkoKlacar
        Recognized Expert Contributor
        • Aug 2007
        • 296

        #4
        Hey guys,

        You've answered my question, I suspected it was not possible to do it anyway.

        Thanks....

        /MK

        Comment

        Working...