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.
    Roberet

    <table>
           <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="http://www.quantum-radio.uk/java/clock.js"></SCRIPT>
    				<script>
    				var dt = new Date();
    				dt = dt.toGMTString();
    				dt = dt.substr(0,16);
    				document.write('<br><b>'+dt+'</b>');
    				</script> <small>GMT</small>
    				</div>           
    				</div>
                  </td>
    </tr>
    </table>

    and the clock.js file is like this

    var clocksize;
    if(!clocksize||clocksize=='SIZE')clocksize='100';
    
    document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+clocksize+'" HEIGHT="'+clocksize+'">');
    
    document.write('<PARAM NAME="movie" VALUE="https://quantum-radio.net/flash/clock.swf">');
    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>');
    
    document.write('</OBJECT>');
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.