Implementing Javascript in Header.php
-
Hello Everyone,
In the header.php I have link that uses image mapping, it also uses a shortcode via a plug-in to display different content in the different times of the day and the week in that same area. This link opens a “_blank” and let’s the visitor listen to a radio stream. The provider of this radio stream wanted to change the link. Here we go:
They wanted me to add this to <HEAD>:
<script language=javascript src="http://nick8.surfernetwork.com/Media/player/scripts/launch.js"> </script>
… which is of course, simple. And the site runs fine with this in header.php.However they wanted me to replace the link with this:
<a href="javascript:callLTR='SGN';grptuner='';file='';title='';ListenLive();" target="_self"> Listen Live </a >
… this is part I having trouble with.Currently what I have is:
<?php echo do_shortcode('[timed onday="1" ontime="1500" offtime="1900"]<p class="smallbanner"><img src="http://www.sgnthelight.com/wp-content/uploads/2014/10/listenLive_TBMS.png" width="470" height="56" border="0" usemap="#smallbannermap" /> <map name="smallbannermap" id="smallbannermap"> <area shape="rect" coords="2,2,467,54" href="http://lightningstream.surfernetwork.com/Media/player/view/SGN_gsl.asp?StreamingServerName=nick11y&call=SGN&targetWidth=1000&targetHeight=800" target="_blank" /> </map></p>[/timed]'); ?>
So, if I put the code in it, it becomes:
<?php echo do_shortcode('[timed onday="1" ontime="1500" offtime="1900"]<p class="smallbanner"><img src="http://www.sgnthelight.com/wp-content/uploads/2014/10/listenLive_TBMS.png" width="470" height="56" border="0" usemap="#smallbannermap" /> <map name="smallbannermap" id="smallbannermap"> <area shape="rect" coords="2,2,467,54" href="javascript:callLTR='SGN';grptuner='';file='';title='';ListenLive();" target="_blank" /> </map></p>[/timed]'); ?>
… and once this is implemented the site doesn’t even open, just a blank page comes up.
Even though I know an imagemap won’t cause it I wanted to try it without that code anyways… so, I’ve reduced the code to work without image mapping… but still doesn’t work, I get the same blank page.
How can I make this happen? Thank you very much in advance.
- The topic ‘Implementing Javascript in Header.php’ is closed to new replies.