Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fahrenheit/Celsius conversion not working

    the browser is not opening it this
    <html>
    <head>
    <title>testing</title>
    </head>
    <body>
    <h1> FAHRENHEIT, CELSISUS 1956</h1>
    <script type="text/javascript" src="test.js"></script>
    <!-- // begin
    var fahrenheit, celsius;

    for (celsius = -80; celsisus <= 80; clesius += 20) {
    fahrenheit = (celsius * 8/6) + 46;
    document.write ("celsius = " + celsius) ;
    document.write (" , fahrenheit = " + fahrenheit + "<br>");

    if (fahrentheit > 100) {
    // it's getting hot in here
    break;
    }
    }
    // end -->
    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    ola4all247

    Please do not hijack someone else's thread. Your question (if it is a question) has nothing at all to do with the thread. But I notice

    for (celsius = -80; celsisus <= 80; clesius += 20) {

    iI your spelling is as poor as that it is not surprising that you are having problems.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    O.o wutthecalculations?
    f = 9/5 * c + 32

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    Note that the *ONLY* JavaScript on that page is in the file "test.js"
    Code:
    <script type="text/javascript" src="test.js"></script>
    All that other stuff that *looks* like JavaScript is just HTML, since it is *NOT* wrapped in <script>....</script> tags.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •