When I use the following code on a regular web page I have no issues but when I load it in PHP/Joomla, neither script works & I get some of the script output at the top of the screen. I know I’m a Javascript idiot but it has to be something simple I’m overlooking.
Here’s the link to my site where you can see the results: [URL=”http://www.lovesongsforsale.com/index.php/Valentines/”]
[CODE]<script type=”text/javascript”>
var lyrics =
“Such a fine little girl, my little <b>:::</b>.<br />”+
var Content = lyrics;
function updateContent(obj){
Content = lyrics;
var objContent = document.getElementById(‘ContentID’);
Content = Content.replace(/:::/g,obj);
objContent.innerHTML = Content;
}
var names = “{mp3}::1{/mp3}<br>” + “<a href=http://www.::1.com> Add to cart</a>”
;
var Content = names;
function updateNameList(obj){
Content = names;
var objContent = document.getElementById(‘namelinksID’);
Content = Content.replace(/::1/g,obj);
objContent.innerHTML = Content;
}
</script>
<table cellspacing=”0″ cellpadding=”0″ width=”100%” border=”0″>
<tbody>
<tr>
<td valign=”top” width=”70%”>
<p>{tab=Song Info} <span class=”SongType”>THIS PAGE IS UNDER CONSTRUCTION – PLEASE CHECK BACK IN AUG ’08!</span></p>
<p><span class=”SongHead”>Description:</span></p>
<p>Ahh young love. Whether you’ve been married for years, remembering the first time you met or you’re thinking about proposing to the girl of your dreams, this song will sum up your feelings perfectly.</p>
<div class=”Songinfo” id=”SongInfo”>
<p><span class=”SongHead”><img alt=”” align=”left” src=”/images/stories/iconmusicstaffwglobe.png” /></span><span class=”SongHead”>Song Type: </span><span class=”SongType”>Your Name Here</span> <strong><br />
"Valentine"</strong> is a "Your Name Here" song which means it <u><strong>is available for immediate download</strong></u>.</p>
<br />
<p><strong><img alt=”” align=”left” src=”/images/stories/help.png” /></strong><strong>How does it work? </strong>Play the original song (to the right –>) & then listen to the version with your loved one’s name in it (below). View the lyrics tab (^above) to see how their name will fit in the song.</p>
<br />
<p><strong>What if their name is not on the drop down list?</strong> Contact us (<a href=”index.php/Contact-Us/”>here</a>) & request the name to be added. We will contact you when it’s ready for download.</p>
<br />
<p><strong><img alt=”” align=”left” src=”/images/stories/headphonescart.png” /></strong><strong>Awesome! I’m ready to download! What’s next? </strong>Select the name from the list below & add it to your cart. You may also want to view our <a target=”_blank” href=”index.php/Gift-Packages/Gift-Packages.html”>gift packages</a> to make it a great gift!</p>
<p> </p>
<hr />
<p><strong><img height=”50″ alt=”” width=”50″ align=”left” src=”images/stories/iconmusicstaffwpencil.png” /></strong><strong><span class=”SongHead”>Song Type: </span><span class=”SongType”>Melody Template Song</span><br />
</strong><strong>Want it in your own words? </strong>This song is also available in Melody Template format. It is the same song, with the melody but no lyrics. Simply fit your own words/lyrics to the melody & voila! A beautiful song from your heart!</p>
<br />
<p align=”left”><strong><img alt=”” align=”left” src=”/images/stories/help.png” /></strong><strong>OK, I’m interested in trying my own lyrics. What’s next? </strong></p>
<div align=”center”><span class=”SongPlayerTitle”>Listen to the "My Little Valentine" Melody Template. <br />
</span>{mp3}valentinemelody{/mp3}</div>
<p>Need help with lyrics ideas? Go <a target=”_blank” href=”http://www.lyricideas.com/”>here</a>. *Yes you can use our lyrics if that’ll help!</p>
<br />
<p><strong><img alt=”” align=”left” src=”/images/stories/headphonescart.png” /></strong><b>Ready to try it?</b> Go <a href=”index.php/component/option,com_rsform/Itemid,140/”>here</a> to complete our <strong>Melody Template Form</strong> & we’ll get started on your new song!</p>
<p> </p>
<p>Please order at least 4 weeks in advance of Valentine’s Day! Rush orders are available.</p>
</div>
<p><img style=”width: 429px; height: 25px” height=”32″ alt=”musicstaff3divider.gif” width=”32″ align=”bottom” src=”/images/stories/musicstaff3divider.gif” /><br />
{tab=Lyrics} </p>
<p>
<select id=”nameID” onchange=”updateContent(this.value);” name=”names”>
<option value=””>Select Name</option>
<option value=”Angela”>Angela</option>
<option value=”Ashley”>Ashley</option>
<option value=”Brittney”>Brittney</option>
</select>
</p>
</p>
<div class=”contentBox” id=”contentID”>
Select a name from the select boxes above.
</div>
<p> </p>
<p style=”text-align: center”><span><img style=”width: 409px; height: 25px” height=”32″ alt=”musicstaff3divider.gif” width=”32″ align=”bottom” src=”/images/stories/musicstaff3divider.gif” /></span></p>
<p>{tab=Story Behind Song}<img id=”songwriter” height=”101″ alt=”” hspace=”5″ width=”100″ align=”left” vspace=”5″ name=”songwriter” src=”/images/stories/songwriteratpiano.jpg” /></p>
<p>Ryan originally wrote this song for this girlfriend at the time. They’d seen each other at parties but never got the chance to really talk. Ryan said, "There was something in her eyes that told me she liked me but I wasn’t sure. And even though I hardly knew her, she was all I could think about. <br />
<br />
I started playing guitar & this it just came out. It was written in 30 minutes. Those are always the best songs, the ones that write themselves."</p>
<br />
{xtypo_quote} even though I hardly knew her, she was all I could think about – Ryan{/xtypo_quote}
<p> </p>
<p>By the time they finally got together, he developed such strong feelings for her, he was already deeply in love & had a wonderful song to show her.</p>
<br />
<p style=”text-align: center”><span><img style=”width: 409px; height: 25px” height=”32″ alt=”musicstaff3divider.gif” width=”32″ align=”bottom” src=”/images/stories/musicstaff3divider.gif” /></span></p>
</td>
<td> </td>
<td valign=”top” align=”center” width=”50%”>
<table height=”223″ cellspacing=”0″ cellpadding=”0″ width=”205″ align=”right” border=”0″ border-style=”inset”>
<caption>
<p> </p>
<br />
</caption>
<tbody>
<tr>
<td bgcolor=”#ededed” colspan=”2″>
<p class=”style1″ style=”text-align: center”><img height=”147″ alt=”couplesmiling200width.jpg” width=”200″ src=”/images/stories/couplesmiling200width.jpg” /></p> </td>
</tr>
<tr>
<td bgcolor=”#ededed”>
<p class=”style1″><img height=”50″ alt=”” hspace=”3″ width=”50″ align=”left” vspace=”3″ src=”/images/stories/headphonesplay.png” /></p> </td>
<td bgcolor=”#ededed”>{mp3}valentine{/mp3}</td>
</tr>
<tr>
<td style=”text-align: center” bgcolor=”#ededed” colspan=”2″>
<p class=”SongPlayerTitle”>Listen to "My Little Valentine"</p> </td>
</tr>
<tr>
<td style=”text-align: center” bgcolor=”#ededed” colspan=”2″><hr /> </td>
</tr>
<tr>
<td style=”text-align: center” bgcolor=”#FFCC33″><img src=”/images/stories/girluser.png” alt=”” width=”48″ height=”48″ hspace=”3″ align=”left” /></td>
<td style=”text-align: center” bgcolor=”#FFCC33″>Names available<br>
<select id=”peopleID” onChange=”updateNameList(this.value);” name=”people”>
<option value=””>Select Name</option>
<option value=”Angela”>Angela</option>
</select></td>
</tr>
<tr>
<td colspan=”2″ bgcolor=”#FFCC33″ style=”text-align: center”><div id=”namelinksID”> * </div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Thanks in advance for your help!