Kapacity Posted April 20, 2007 Share Posted April 20, 2007 When the user clicks on a button, it links them over to a different page on the website. The reason why I need to have a change of direction is if it's a different browser. The two main browsers I'm altering my website to fit is (Microsoft Internet Explorer & Mozilla Firefox aka Netscape). Unfortunately I don't have any code to help out for that I don't even know where to begin scripting this. please help.. Link to comment Share on other sites More sharing options...
aspnetguy Posted April 20, 2007 Share Posted April 20, 2007 first off Firefox is not Netscape. Firefox is created by Mozilla, Netscape is not. Infact Netscape abandoned their own engine and switched to Gecko (the engine Firefox uses) when they released Netscape 8.If you just want the user to go to another page with they click a button you coudl do this. <input type="buton" value="Click Me" onclick="window.location='url to to other page'"/> Link to comment Share on other sites More sharing options...
pulpfiction Posted April 20, 2007 Share Posted April 20, 2007 Try something like this..... <script language="JavaScript">function redirect() {var browserName=navigator.appName; if (browserName=="Netscape"){ window.location = "URL for Netscape or FF";}else if (browserName=="Microsoft Internet Explorer") {window.location = "URL for IE"; }}</SCRIPT></head><body><input type="button" value="Click Me" onclick="java script:redirect();"/>....... Link to comment Share on other sites More sharing options...
Kapacity Posted April 20, 2007 Author Share Posted April 20, 2007 <script language="JavaScript">function redirect() {var browserName=navigator.appName;if (browserName=="Netscape"){window.location = "URL for Netscape or FF";}else if (browserName=="Microsoft Internet Explorer"){window.location = "URL for IE";}}</SCRIPT></head><body><img name="home" width="150px" height="50px" src="Graphics/home1.gif" onmouseOver="mouseOver('home')" onmouseOut="mouseOut('home') onclick="redirect()"></body> This is pretty much what I'm trying to do. I have linked images that use the onmouseover & onmouseout, however when I add a 3rd function to be called it disables the other two. why is this and how can I get this image to use that redirect function without problems? Link to comment Share on other sites More sharing options...
pulpfiction Posted April 20, 2007 Share Posted April 20, 2007 If this is exactly how your code is, then you are missing a double quotes at the end of onmouseout event function call.... normally it onclick should not affect the other 2 events....<img name="home" width="150px" height="50px" src="Graphics/home1.gif" onmouseOver="mouseOver('home')" onmouseOut="mouseOut('home')" onclick="redirect()"> Link to comment Share on other sites More sharing options...
Kapacity Posted April 20, 2007 Author Share Posted April 20, 2007 I resolved it guys. Thank you everyone who has helped. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now