Jump to content
  • Advertisement
Sign in to follow this  
Lenggo

[web] xml website with javascript

This topic is 3923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im having some problems with getting javascript to work with my site thats using xml. All I am doing is using the javascript to create popup menus and for some reason they are not displaying at all. I tried to find info on it but couldnt find anything really useful and Im not really sure that its even possible. Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Sorry, im still kind of new at this. Heres the xsl file thats binded to the xml.
Basically, I made a site with dreamweaver and added javascript popup menus that appear when I roll over a specific button from there. The site works as html, but when I converted it to something more dynamic, I lost some functionality as anything that was javascript related no longer works.


<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY copy "&#169;">
<!ENTITY reg "&#174;">
<!ENTITY trade "&#8482;">
<!ENTITY mdash "&#8212;">
<!ENTITY ldquo "&#8220;">
<!ENTITY rdquo "&#8221;">
<!ENTITY pound "&#163;">
<!ENTITY yen "&#165;">
<!ENTITY euro "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>web2d.gif</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- Fireworks MX Dreamweaver MX target. Created Tue Aug 14 21:49:49 GMT-0400 (Eastern Daylight Time) 2007-->
<script language="JavaScript" type="text/javascript">
<xsl:comment>
<xsl:text disable-output-escaping="yes">
<![CDATA[
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function mmLoadMenus() {
if (window.mm_menu_0807175536_0) return;
window.mm_menu_0807175536_0 = new Menu("root",142,25,"Verdana, Arial, Helvetica, sans-serif",14,"#ffffff","#ffffff","#009600","#00ea00","center","middle",2,0,1000,-5,7,true,true,true,0,false,false);
mm_menu_0807175536_0.addMenuItem("Intramurals&nbsp;Main");
mm_menu_0807175536_0.addMenuItem("Hockey");
mm_menu_0807175536_0.addMenuItem("Broomball");
mm_menu_0807175536_0.addMenuItem("Softball");
mm_menu_0807175536_0.addMenuItem("Volleyball");
mm_menu_0807175536_0.addMenuItem("Indoor&nbsp;Soccer");
mm_menu_0807175536_0.bgImageUp="images/mmmenu2_142x25_up.gif";
mm_menu_0807175536_0.bgImageOver="images/mmmenu2_142x25_over.gif";
mm_menu_0807175536_0.fontWeight="bold";
mm_menu_0807175536_0.hideOnMouseOut=true;
mm_menu_0807175536_0.bgColor='#555555';
window.mm_menu_0807175001_0 = new Menu("root",71,25,"Verdana, Arial, Helvetica, sans-serif",14,"#ffffff","#ffffff","#009600","#00ea00","center","middle",2,0,1000,-5,7,true,true,true,0,false,false);
mm_menu_0807175001_0.addMenuItem("Video");
mm_menu_0807175001_0.addMenuItem("Pictures");
mm_menu_0807175001_0.bgImageUp="images/mmmenu1_71x25_up.gif";
mm_menu_0807175001_0.bgImageOver="images/mmmenu1_71x25_over.gif";
mm_menu_0807175001_0.fontWeight="bold";
mm_menu_0807175001_0.hideOnMouseOut=true;
mm_menu_0807175001_0.bgColor='#555555';

mm_menu_0807175001_0.writeMenus();
} // mmLoadMenus()

//]]>
</xsl:text>
</xsl:comment>

</script>
<script language="JavaScript1.2" src="mm_menu.js" type="text/javascript"></script>
</head>
<body bgcolor="#000000" onload="MM_preloadImages('images/web2d_r6_c2_f2.gif','images/web2d_r8_c2_f2.gif','images/web2d_r9_c2_f2.gif','images/web2d_r10_c2_f2.gif','images/web2d_r11_c2_f2.gif','images/web2d_r13_c2_f2.gif','images/web2d_r16_c2_f2.gif','images/web2d_r18_c2_f2.gif','images/web2d_r19_c2_f2.gif');">
<div align="center">
<script language="JavaScript1.2" type="text/javascript">
<xsl:text disable-output-escaping="yes">
<![CDATA[mmLoadMenus();]]>
</xsl:text>
</script>
<table bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="1000">
<!-- fwtable fwsrc="web3.png" fwbase="web2d.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="19" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="161" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="20" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="280" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="40" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="30" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="25" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="50" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="175" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="20" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="161" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="19" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>

<tr>
<td colspan="7"><img src="images/web2d_r1_c1.gif" alt="" name="web2d_r1_c1" width="575" height="123" border="0" id="web2d_r1_c1" /></td>
<td><img src="images/web2d_r1_c8.gif" alt="" name="web2d_r1_c8" width="50" height="123" border="0" id="web2d_r1_c8" /></td>
<td colspan="4"><img src="images/web2d_r1_c9.gif" alt="" name="web2d_r1_c9" width="375" height="123" border="0" id="web2d_r1_c9" /></td>
<td><img src="images/spacer.gif" width="1" height="123" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="7"><img src="images/web2d_r2_c1.gif" alt="" name="web2d_r2_c1" width="575" height="29" border="0" id="web2d_r2_c1" /></td>
<td><img src="images/web2d_r2_c8.gif" alt="" name="web2d_r2_c8" width="50" height="29" border="0" id="web2d_r2_c8" /></td>
<td colspan="4"><img src="images/web2d_r2_c9.gif" alt="" name="web2d_r2_c9" width="375" height="29" border="0" id="web2d_r2_c9" /></td>
<td><img src="images/spacer.gif" width="1" height="29" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="12" bgcolor="#000000"><img src="images/spacer.gif" width="1000" height="18" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="18" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="18" bgcolor="#000000"><img src="images/spacer.gif" width="19" height="530" border="0" alt="" /></td>
<td rowspan="2"><img src="images/web2d_r4_c2.gif" alt="" name="web2d_r4_c2" width="161" height="32" border="0" id="web2d_r4_c2" /></td>
<td rowspan="18" bgcolor="#000000"><img src="images/spacer.gif" width="20" height="530" border="0" alt="" /></td>
<td colspan="6" background="images/web2d_r4_c4.gif">&nbsp;</td>
<td rowspan="18" bgcolor="#000000"><img src="images/spacer.gif" width="20" height="530" border="0" alt="" /></td>
<td rowspan="2"><img src="images/web2d_r4_c11.gif" alt="" name="web2d_r4_c11" width="161" height="32" border="0" id="web2d_r4_c11" /></td>
<td rowspan="18" bgcolor="#000000"><img src="images/spacer.gif" width="19" height="530" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="23" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="6" rowspan="2" background="images/web2d_r5_c4.gif">&nbsp;</td>
<td><img src="images/spacer.gif" width="1" height="9" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r6_c2','','images/web2d_r6_c2_f2.gif',1);"><img src="images/web2d_r6_c2.gif" alt="" name="web2d_r6_c2" width="161" height="49" border="0" id="web2d_r6_c2" /></a></td>
<td rowspan="5" valign="top" background="images/web2d_r6_c11.gif">&nbsp;</td>
<td><img src="images/spacer.gif" width="1" height="13" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="3" rowspan="7" valign="top" background="images/web2d_r7_c4.gif">&nbsp;</td>
<td colspan="3" rowspan="7" background="images/web2d_r7_c7.gif"><div align="center"><img name="" src="" width="225" height="225" alt="" /></div></td>
<td><img src="images/spacer.gif" width="1" height="36" border="0" alt="" /></td>
</tr>
<tr>
<td><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r8_c2','','images/web2d_r8_c2_f2.gif',1);"><img src="images/web2d_r8_c2.gif" alt="" name="web2d_r8_c2" width="161" height="50" border="0" id="web2d_r8_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
<tr>
<td><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r9_c2','','images/web2d_r9_c2_f2.gif',1);"><img src="images/web2d_r9_c2.gif" alt="" name="web2d_r9_c2" width="161" height="50" border="0" id="web2d_r9_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
<tr>
<td><a href="#" onmouseout="MM_swapImgRestore();MM_startTimeout();" onmouseover="MM_showMenu(window.mm_menu_0807175536_0,161,0,null,'web2d_r10_c2');MM_swapImage('web2d_r10_c2','','images/web2d_r10_c2_f2.gif',1);"><img src="images/web2d_r10_c2.gif" alt="" name="web2d_r10_c2" width="161" height="50" border="0" id="web2d_r10_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><a href="#" onmouseout="MM_swapImgRestore();MM_startTimeout();" onmouseover="MM_showMenu(window.mm_menu_0807175001_0,161,0,null,'web2d_r11_c2');MM_swapImage('web2d_r11_c2','','images/web2d_r11_c2_f2.gif',1);"><img src="images/web2d_r11_c2.gif" alt="" name="web2d_r11_c2" width="161" height="50" border="0" id="web2d_r11_c2" /></a></td>
<td bgcolor="#000000"><img src="images/spacer.gif" width="161" height="17" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="17" border="0" alt="" /></td>
</tr>
<tr>
<td><img src="images/web2d_r12_c11.gif" alt="" name="web2d_r12_c11" width="161" height="33" border="0" id="web2d_r12_c11" /></td>
<td><img src="images/spacer.gif" width="1" height="33" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="3"><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r13_c2','','images/web2d_r13_c2_f2.gif',1);"><img src="images/web2d_r13_c2.gif" alt="" name="web2d_r13_c2" width="161" height="50" border="0" id="web2d_r13_c2" /></a></td>
<td rowspan="8" valign="top" background="images/web2d_r13_c11.gif">&nbsp;</td>
<td><img src="images/spacer.gif" width="1" height="14" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="6" bgcolor="#000000"><img src="images/spacer.gif" width="600" height="15" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="15" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><img src="images/web2d_r15_c4.gif" alt="" name="web2d_r15_c4" width="280" height="24" border="0" id="web2d_r15_c4" /></td>
<td rowspan="7" bgcolor="#000000"><img src="images/spacer.gif" width="40" height="220" border="0" alt="" /></td>
<td rowspan="2" colspan="4"><img src="images/web2d_r15_c6.gif" alt="" name="web2d_r15_c6" width="280" height="24" border="0" id="web2d_r15_c6" /></td>
<td><img src="images/spacer.gif" width="1" height="21" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r16_c2','','images/web2d_r16_c2_f2.gif',1);"><img src="images/web2d_r16_c2.gif" alt="" name="web2d_r16_c2" width="161" height="50" border="0" id="web2d_r16_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="3" valign="top" background="images/web2d_r17_c4.gif">&nbsp;</td>
<td colspan="4" rowspan="3" valign="top" background="images/web2d_r17_c6.gif">&nbsp;</td>
<td><img src="images/spacer.gif" width="1" height="47" border="0" alt="" /></td>
</tr>
<tr>
<td><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r18_c2','','images/web2d_r18_c2_f2.gif',1);"><img src="images/web2d_r18_c2.gif" alt="" name="web2d_r18_c2" width="161" height="50" border="0" id="web2d_r18_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><a href="#" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('web2d_r19_c2','','images/web2d_r19_c2_f2.gif',1);"><img src="images/web2d_r19_c2.gif" alt="" name="web2d_r19_c2" width="161" height="49" border="0" id="web2d_r19_c2" /></a></td>
<td><img src="images/spacer.gif" width="1" height="19" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2" bgcolor="#000000"><img src="images/spacer.gif" width="280" height="80" border="0" alt="" /></td>
<td rowspan="2" colspan="4" bgcolor="#000000"><img src="images/spacer.gif" width="280" height="80" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="30" border="0" alt="" /></td>
</tr>
<tr>
<td bgcolor="#000000"><img src="images/spacer.gif" width="161" height="50" border="0" alt="" /></td>
<td bgcolor="#000000"><img src="images/spacer.gif" width="161" height="50" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
{/source]


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!