Mutley Posted January 25, 2009 Share Posted January 25, 2009 <script language='javascript'> var name = confirm("Are you sure you wish to purchase a <?=$conMan?> <?=$conNam?>?"); if(name==true){ window.location.href='shop.php?cat=<?=$cat?>&prod_id=<?=$prod_id?>&confirm=1'; }else{ window.location.href='shop.php?cat=<?=$cat?>'; } </script> It pops up but when you select "Okay" it doesn't do anything... like it isn't true? Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/ Share on other sites More sharing options...
webster08 Posted January 25, 2009 Share Posted January 25, 2009 you need to check the window.location.href in your if/else condition and use the confirm accordingly; don't check if the confirm is true or false. Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-745973 Share on other sites More sharing options...
Mutley Posted February 7, 2009 Author Share Posted February 7, 2009 How do you mean, sorry? Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-756786 Share on other sites More sharing options...
webster08 Posted February 7, 2009 Share Posted February 7, 2009 what are you trying to accomplish? i think you just need to google "javascript confirm prompt"; that will put you in the right direction. Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-756951 Share on other sites More sharing options...
corbin Posted February 7, 2009 Share Posted February 7, 2009 Try changing window.location.href to window.location. Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-757048 Share on other sites More sharing options...
Mutley Posted February 13, 2009 Author Share Posted February 13, 2009 Tried that but no luck. I'm trying to do a simple, if confirmation is Yes, redirect to XYZ page, if not, redirect to ABC page. Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-761338 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Hrmm works fine for me x.x if I just put http://google.com/ as one location and http://msn.com/ as the other. Link to comment https://forums.phpfreaks.com/topic/142346-simple-script-wont-work-in-safari/#findComment-761501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.