I have a site through Wordpress. On this site, I added some code to my homepage. When I clicked the 'preview updates' button in the edit page, it brought me to preview page where the code was functioning properly. So, I clicked the update page button and went to check it out. To my great dismay, I found that my code did not work. I ran it with an html tester, and it worked fine there as well. I have repeated the previous process multiple times, and have gotten no further.
This is the code I used:
<script language="javascript">
var pic='';
mytime=new Date();
mymonth=mytime.getMonth()+1;
mydate=mytime.getDate();
if (mymonth==12 && mydate<=7){pic="A<img src='https://docs.google.com/drawings/d/e/2PACX-1vSacccpe1ePniRET6J7Rt_GMuJKl-MTamK-y_9UnfDELETING FOR PRIVACY-vWc8aYZ/pub?w=1384&h=636' alt='NEW Notif'>";
}
else if (mymonth==11 && mydate<=30){pic="B<img src='https://docs.google.com/drawings/d/e/2PACX-1vSacccpe1ePniRET6J7Rt_GMuJKl-MTamK-y_9UnfDELETING FOR PRIVACY-vWc8aYZ/pub?w=1384&h=636' alt='m11'>";
}
else if (mymonth==12 && mydate>=8){pic="C<img src='https://docs.google.com/drawings/d/e/2PACX-1vQ4qWKJx8SQzNpUgUjpKvid6MPbohLwkn__KKqj5_DELETING FOR PRIVACY-XB-3d2iVq/pub?w=1384&h=636' alt='Copy of Notif'>";
}
else {
pic="<b>An error has occurred - notifications will not be shown</b>"
}
document.write(pic);
</script>
Basically all this code does is display a notification, but it automatically updates the notification if that event (talked about in the notification) has passed. I'd be more than open to other methods of doing this (just no jQuery!), as long as they would solve/get around my issue. I'm a bit of a newbie. Thanks in advance!
Rob