glenvern Posted May 22, 2013 Share Posted May 22, 2013 Can someone tell me why this script doesn't work please... <script type="text/javascript"> if (browser=="MSIE"){location.href=("http://glenvern.co.uk/blogs/tatsy/wma/1 will you.wma");}else{location.href={"http://glenvern.co.uk/blogs/tatsy/mp3/1 will you.mp3");}</script> Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2013 Share Posted May 22, 2013 What exactly do you think doesn't work about it? Where do you define the browser variable? Link to comment Share on other sites More sharing options...
glenvern Posted May 22, 2013 Author Share Posted May 22, 2013 oops - now your taking me into the unknown.. What's a browser variable> I've not got into scripts so I know nothing, if it's complicated I'll give it a miss.but it would have been nice to see something like that working so I could play music on my website.if all the browsers played mp3 I wouldn't have a problem, but I can't get IE to play it. Any simple suggestion would be welcome.. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2013 Share Posted May 22, 2013 I'm talking about this: if (browser=="MSIE") You're checking a variable called browser to see what it is set to. There is no pre-defined variable called "browser", if that variable is going to have a value then you need to be setting it somewhere. There are a couple examples of checking for IE here: http://stackoverflow.com/questions/4169160/javascript-ie-detection-why-not-use-simple-conditional-comments 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