Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS if ie -> if win howto

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #25469
    jakab
    Member

    Hi

    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!!

    #60747
    TheDoc
    Member

    There 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):

    http://www.netobjects.com/workbench/js_css.html

    #60748
    jakab
    Member

    I 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(“”) }

    #60750
    TheDoc
    Member

    Like 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?

    #60756
    jakab
    Member

    I 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.html

    Ok, 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

    #60763
    jakab
    Member

    I’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>

    #60789
    jakab
    Member

    http://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>

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.