Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alert and redirect 2

Status
Not open for further replies.

travisbrown

Technical User
Joined
Dec 31, 2001
Messages
1,016
I asked this before once, but can't seen to get it working.

Want to redirect once a user clicks okay ina js alert.

Code:
<html>
 <head>
 </head>
 <body>
   <script language="javascript">
    <!--
     alert("alert");
     window.location = "[URL unfurl="true"]http://google.com"[/URL]
     return true;
    -->
    </script>
</body>
</html>
 
Scripts generally go in the HEAD section. No need to "return true" as this isn't a function call.

Still, it looks like it should work.

What happens when you run this?

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
script --> head tag...yeah, I see I accidentally pasted it in the body tag in the post. It's in the head.

return true gone, works now. Too early here.

thanks guys.

t.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top