- This topic is empty.
-
AuthorPosts
-
July 15, 2009 at 1:07 pm #25469
jakab
MemberHi
I know that there’s this html code:
<!–[if IE]>
Hi, you’re using ie!
<![endif]–>But is there an html code "when using windows"? Like the previous code only say’s:
"Hi, you’re using ie!"
when the visitor is browsing under ie, But is there a code that say’s something when browsing under windows? e.g.: [sorry for the example :D ]
<!–[if windows]>
Hi, you’re using windows!
<![endif]–>Thank you!!
July 15, 2009 at 1:13 pm #60747TheDoc
MemberThere should never be big enough differences between Windows and OS X to need to have separate style sheets, but here’s some JS that says it does it (no idea how old it is):
July 15, 2009 at 1:29 pm #60748jakab
MemberI tried the second script on this page:
http://www.netobjects.com/workbench/js_css.html
but under windows (firefox), under Debian (iceweasel) it gives the following (the same):
document.writeln(“â€) } else { document.writeln(“â€) }
July 15, 2009 at 1:58 pm #60750TheDoc
MemberLike I said, I have no idea how old the code is, nor if it actually works.
I will repeat though, there should be no reason that you will need different style sheets depending on the operating system. Why do you need to do this?
July 15, 2009 at 2:20 pm #60756jakab
MemberI checked:
http://www.netobjects.com/workbench/js_css.html
http://www.java2s.com/Tutorial/JavaScri … atform.htm
http://www.javascripter.com/faq/operatin.htm
http://www.web-wise-wizard.com/javascri … ation.htmlOk, so there could be a way… :D
Can anyone write a javascript, that would check the "navigator.platform" for string "win"? But making it lowercase before checking :D (so that it would surely find windows os :D )
I only want to show this to the visitor, when browsing under windows (not a text :D ):
<div align="center"><font size=4><table width="100%"><tr><td>under windows</td></tr></table></font></div>
thank you :D
July 15, 2009 at 2:47 pm #60763jakab
MemberI’m trying, but it still doesn’t work :D
<html>
<head>
</head>
<body>
<script language="JavaScript">if (navigator.platform.toLowerCase().indexOf(“win”)!=-1)
{
<div align="center"><font size=4><table width="100%"><tr><td>under windows</td></tr></table></font></div>
}</script>
</body>
</html>July 15, 2009 at 5:56 pm #60789jakab
Memberhttp://scriptasylum.com/tutorials/encde … ecode.html
<html>
<head>
<title>
</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">if (navigator.platform.toLowerCase().indexOf("win")!=-1)
{
document.write(navigator.platform.toLowerCase());
document.write( unescape( ‘%3C%62%72%20%2F%3E’ ) );
document.write( unescape( ‘%3C%66%6F%6E%74%20%73%69%7A%65%3D%34%3E%3C%74%61%62%6C%65%20%77%69%64%74%68%3D%22%31%30%30%25%22%20%62%67%63%6F%6C%6F%72%3D%22%23%65%65%65%65%65%65%22%3E%3C%74%72%20%2F%3E%3C%74%64%20%2F%3E%79%6F%75%27%72%65%20%75%73%69%6E%67%20%77%69%6E%64%6F%77%73%3C%74%64%20%2F%3E%3C%74%72%20%2F%3E%3C%74%61%62%6C%65%20%2F%3E%3C%66%6F%6E%74%20%2F%3E’ ) );
}</script>
</body>
</html> -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.