Jump to content

Jonas

Members
  • Posts

    2,402
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Jonas

  1. Ok, so it wasn't that hard after all... :(
      <script type="text/javascript">  	var useragent = navigator.userAgent;  	var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;  	if (bName == "Opera") {    document.write('<link type="text/css" rel="stylesheet" href="opera.css" />')  	}  	else if (bName == "Netscape") {    document.write('<link type="text/css" rel="stylesheet" href="netscape.css" />')  	}  	else {    document.write('<link type="text/css" rel="stylesheet" href="microsoft.css" />')  	}  </script>

    LOL! With this new code I get validation error, saying <link> element is not allowed where it is. :) I just cheated using document.write('<'+'...') :) Now I just get a warning, but still valid xhtml 1.1... :D
  2. Ok, so it wasn't that hard after all... :)

      <script type="text/javascript"> 	 var useragent = navigator.userAgent; 	 var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName; 	 if (bName == "Opera") {    document.write('<link type="text/css" rel="stylesheet" href="opera.css" />') 	 } 	 else if (bName == "Netscape") {    document.write('<link type="text/css" rel="stylesheet" href="netscape.css" />') 	 } 	 else {    document.write('<link type="text/css" rel="stylesheet" href="microsoft.css" />') 	 }  </script>

  3. Hey. Nice design there... :)But it would be great if you could please remove the

    onmouseover="window.status=' <FreeHTMLab.com> ';return true"

    part from here:

    <BODY bgcolor="#000000" onmouseover="window.status=' <FreeHTMLab.com> ';return true" background="http://www.freehtmlab.com/images/indexbg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#ffffff" vlink="#ffffff">

    , because it's always nice to see in the status bar where the link takes you. Not knowing where you're navigating is a trademark of the less "kocher" sites if you get my meaning. And that's not good. I never click links I don't know where takes me... :)

  4. Ok, so I've used simple scripts for some time, and now I'm making a site for my dad's company. However, due to Internet Explorer and Mozilla Firefox's showing css differently from the browser I'm using (Opera), I'm not managing to show the site the way I want.http://www.w3schools.com/js/tryit.asp?file...js_crossbrowserSo, after reading that, and also having searched around a bit on the web, is there any way of redirecting to different browsers. My biggest problem so far is that Opera disguises itself as Internet Explorer when "navigator.appname" is called through a function. Also, I found this script:http://www.cssplay.co.uk/archive/themes_v2.json this site:http://www.cssplay.co.uk/and it gave me the idea of just switching stylesheet based on browser. I managed to make a script where you could choose stylesheet through <select> and <option>. But that doesn't work in IE for some reason, and besides I don't want to have the reader change stylesheet for every new link or update. Like I said, ideally the ideal stylesheet should be chosen based on browser. SO, is there anyway of doing this? Any ideas? Could navigator.userAgent be an idea? Can anyone good at javascript help me with this?Any help highly appreciated... :)

×
×
  • Create New...