hi all
this is the first time i have tried to put javascript calls into our global template and I appear to be having some problems. When previewing the pages the javascript is not activated.
I have followed the markup as suggested in the developer guide (posted below) and wondered if any of you could see anything obviously wrong with this as to why it doesn’t work.
i have 3 calls to external javascript files - these appear not to be being called when the page loads. The next call which contains javascript rx is replacing my greater than sign with > which i dont want to happen.
<script language="javascript" psx-src="$rxs_navbase/js/jquery-1.2.3.js" src="js/jquery-1.2.3.js" type="text/javascript">;</script>
<link type='text/css' psx-href='$rxs_navbase/css/ui.tabs.css' href='css/ui.tabs.css' rel='stylesheet' media='print, projection, screen' />
<script language="javascript" psx-src="$rxs_navbase/js/jquery-1.2.3.pack.js" src="js/jquery-1.2.3.pack.js" type="text/javascript">;</script>
<script language="javascript" psx-src="$rxs_navbase/js/ui.tabs.pack.js" src="js/ui.tabs.pack.js" type="text/javascript">;</script>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
$(function() {
$('#Terms \> ul').tabs({ fx: { opacity: 'toggle' } });
});
/* ]]> */
</script>
<script type="text/javascript" language="javascript">
function insertParaNumbers () {
var terms = document.getElementById('Terms');
var sections = terms.getElementsByTagName('div');
var headers = terms.getElementsByTagName('h2');
j = headers.length;
headerNo = 0;
for(var i=0;i<j;i++)
{
if (sections[i].className != 'CrossRefBox') {
headerNo = headerNo+1;
insertH2 = "<span>"+headerNo+"</span>";
headers[i].innerHTML = insertH2+headers[i].innerHTML;
var paras = sections[i].getElementsByTagName('p');
y = paras.length;
paraNo=0;
for (var x=0;x<y;x++) {
if (paras[x].className != 'NoNumber') {
paraNo = paraNo+1;
insertPara = "<span>"+headerNo+"."+paraNo+"</span>";
paras[x].innerHTML = insertPara+paras[x].innerHTML;
}
}
}
}
}
window.onload=insertParaNumbers;
</script>
thanks
michelle