Support » Fixing WordPress » Twentyseventeen javascript no longer works

  • I was running a nice little clock on Twentyten, but since migrating to Twentyseventeen, the clock no longer shows up. This first bit of inline script shows the clock, with the current date below it. All tht I get now is the current date? no clock.

    Anybody got any ideas please.

           <tr align="left" valign="top">
                  <td width="36%" rowspan="1" bgcolor="#FFFFFF"><div align="center" class="style6">	
                    <div align='lef>
    				<SCRIPT LANGUAGE="JavaScript">var clocksize='150';</SCRIPT>
    				<SCRIPT SRC=""></SCRIPT>
    				var dt = new Date();
    				dt = dt.toGMTString();
    				dt = dt.substr(0,16);
    				</script> <small>GMT</small>

    and the clock.js file is like this

    var clocksize;
    document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE=",0,0,0" WIDTH="'+clocksize+'" HEIGHT="'+clocksize+'">');
    document.write('<PARAM NAME="movie" VALUE="">');
    document.write('<PARAM NAME="quality" VALUE="high">');
    document.write('<PARAM NAME="bgcolor" VALUE="#ffffff">');
    document.write('<PARAM NAME="wmode" VALUE="transparent">');
    document.write('<PARAM NAME="menu" VALUE="false">');
    document.write('<EMBED SRC="/flash/clock.swf" WIDTH="'+clocksize+'" HEIGHT="'+clocksize+'" QUALITY="high" WMODE="transparent" MENU="false"></EMBED>');
Viewing 1 replies (of 1 total)
  • I’m afraid your approach when adding JavaScript is all wrong. The fact that it has worked thus far, is (I suspect) more due to good luck than good coding. You really need to be enqueuing your script and not passing variables within your page content. Try reviewing Using_Javascript.

    Failing that, have you considered looking for a suitable clock plugin instead?

Viewing 1 replies (of 1 total)
  • The topic ‘Twentyseventeen javascript no longer works’ is closed to new replies.