Support » Fixing WordPress » Adding Javascript to Page?

  • I am currently trying to add the following Javascript into one of my Pages, it is not showing up. If I put the Javascript into my sidebar it works perfectly fine. I just do not want to put it into my sidebar, I want it to work on one of my Pages.

    The script I am trying to use is this:

    			today = new Date();
    			BigDay = new Date("July 15, 2011")
    			msPerDay = 24 * 60 * 60 * 1000 ;
    			timeLeft = (BigDay.getTime() - today.getTime());
    			e_daysLeft = timeLeft / msPerDay;
    			daysLeft = Math.floor(e_daysLeft);
    			e_hrsLeft = (e_daysLeft - daysLeft)*24;
    			hrsLeft = Math.floor(e_hrsLeft);
    			minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
    			document.write(daysLeft + " days");

    Any suggestions on how I can get this to show up?

Viewing 1 replies (of 1 total)
  • The WordPress editor doesn’t play well with code that is out of its bounds, and this is out of its bounds.

    You can add code like this to your pages and posts by using the Raw HTML plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Javascript to Page?’ is closed to new replies.