www.webdeveloper.com
Results 1 to 4 of 4

Thread: Changing div classes works on localhost but not on site

Hybrid View

  1. #1
    Join Date
    Dec 2013
    Posts
    23

    Changing div classes works on localhost but not on site

    I cannot for the life of me figure out why this technique will not display correctly on my hosted site.

    It works fine in the fiddle below as well as locally on my laptop when accessing index.html from a browser.

    http://jsfiddle.net/movnonup/Ev52M/5/

    However, when I upload to the test site and test this snippet in the latest versions of Safari, Opera, Chrome and FF it displays nothing.

    I'm at a loss. The solution is definitely not obvious to me. I can provide the site URL if needed.

  2. #2
    Join Date
    Dec 2013
    Posts
    23
    Ooops, sorry, here's the correct updated fiddle: http://jsfiddle.net/movnonup/Ev52M/6/

  3. #3
    Join Date
    Dec 2013
    Posts
    23
    To clarify, the class 'night' and class 'day' are correctly added to the div ID "timeofday" on the localhost version of my site.

    So, if I view source on the local index.html it correctly displays, for example <div id="timeofday" class="night">

    For whatever strange reason, when I view source on the very same code up on my hosted server, the div remains <div id="timeofday"> with no class added.

  4. #4
    Join Date
    Dec 2013
    Posts
    23
    ugh DUH.... all set folks. Foot firmly in mouth. I had stripped out the onload event in an earlier rev. I had been using $(function()) locally. Added onload back in to <body> and all is well.

    Hope you all have a Merry Christmas, Happy Holidays and the very best New Year.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles