javascript alert and go

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imarkdesigns
    New Member
    • Jul 2007
    • 46

    javascript alert and go

    Good Day,

    just want to ask is there any possible code for javascript after alert window comes out and when you press "ok" it will not get back to the window, it will go to the dedicated page?

    is that possible?
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by imarkdesigns
    Good Day,

    just want to ask is there any possible code for javascript after alert window comes out and when you press "ok" it will not get back to the window, it will go to the dedicated page?

    is that possible?
    What you tried show me that code.
    I think it is possible.......


    Debasis

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #3
      hi ...

      simply set the location.href after the alert. an alert stops execution until the user closes the dialog and after that the execution proceeds. since the alert doesn't return any value the code is executed unconditionally :

      [CODE=javascript]function switch_page() {
      alert('test');
      window.location .href = 'http://www.google.com' ;
      }[/CODE]
      kind regards

      Comment

      Working...