I'm trying to use a very simple piece of Javascript code on a Ning site, but it's not working. Am I missing something obvious, or is it possible Ning is overwriting something?
Any help would be greatly appreciated!
The Javascript code is:
The code is being called from the main page of the site here: http://time4mommy.com/Code:var d=new Date(); var weekday=new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; document.getElementById(weekday[d.getDay()])).style.display = 'block';
The goal is to have different things show up each day of the week. I have 7 divs each with the name of the week like this...
The Javascript code in the link above, theoretically, should display anything within the div with the id of the current day of the week. However, it's not doing that, so currently, I've changed Friday's div style to "display: block;"Code:<div id="Sunday" style="display: none;"></div> <div id="Monday" style="display: none;"></div> <div id="Tuesday" style="display: none;"></div> <div id="Wednesday" style="display: none;"></div> <div id="Thursday" style="display: none;"></div> <div id="Friday" style="display: none;"></div> <div id="Saturday" style="display: none;"></div>
Am I just missing something really obvious? Or does Ning not like my code?
Thanks in advance!


Reply With Quote

Bookmarks