posted 17 years ago
All the parts of the code the poster thing wont allow is seperated by a space
Script.js
var xmlDoc;
products.function(id, name, file_size, summary)
{
this.id=id;
this.name=name;
this.file_size=file_size;
this.summary=summary;
}
function loadXML(){
//load xml file
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("product_info.xml");
var id=attrs.getNamedItem("id").value;
var name=attrs.getNamedItem("name").value;
var version=parseFloat(attrs.getNamedItem("file_size").value)
var file_size=attrs.getNamedItem("summary").value;
getmessage();
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("product_info.xml");
var id=attrs.getNamedItem("id").value;
var name=attrs.getNamedItem("name").value;
var version=parseFloat(attrs.getNamedItem("file_size").value)
var file_size=attrs.getNamedItem("summary").value;
xmlDoc.o nload=getmessage;
}
else
{
alert('Your browser cannot handle this script');
}
}
// Actual message maker
function getmessage()
{
document.getElementById("name").innerHTML=xmlDoc.getElementsByTagName("name")[0].childNodes[0].nodeValue;
document.getElementById("file_size").innerHTML=xmlDoc.getElementsByTagName("file_size")[0].childNodes[0].nodeValue;
document.getElementById("summary").innerHTML=xmlDoc.getElementsByTagName("summary")[0].childNodes[0].nodeValue;
document.getElementById("version").innerHTML=xmlDoc.getElementsByTagName("version")[0].childNodes[0].nodeValue;
}
function dio(){
window.open("dio.html");
}
Programs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="SHORTCUT ICON" href="images/logo_orig/bp.ico" />
<script src="script.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bertolacci Productions~Programs</title>
</head>
<body bgcolor="#fffacd" text="#000000" link="FF4500">
<center>
<h1>Programs</h1>
</center>
<hr color="#CC9900" size=2 width="100%"/>
<center>
<a href="http://www.bertolacciproductions.com"><img src="images/buttons/home.bmp" alt="Home" border="none"/></a>
<a href="new.html"><img src="images/buttons/new.bmp" alt="New" border="none"/></a>
<a href="programs.html"><img src="images/buttons/programs.bmp" alt="Programs" border="none"/></a>
<a href="add-ins.html"><img src="images/buttons/add-ins.bmp" alt="Add-Ins" border="none"/></a>
<a href="box-sets.html"><img src="images/buttons/boxset.bmp" alt="Box Sets" border="none"/></a>
<a href="service.html"><img src="images/buttons/service.bmp" alt="Services" border="none"/></a>
<a href="about.html"><img src="images/buttons/about.bmp" alt="About" border="none"/></a>
<a href="code/codebook.html"><img src="images/buttons/code.bmp" alt="Code Cook Book" border="none"/></a>
</center>
<hr color="#CC9900" size=2 width="100%"/>
<center>
<table border="0">
<tr>
<td width="121">Programs</td>
<td width="121">Games</td>
<td width="121">Other</td>
</tr>
<tr>
<td width="121"></td>
<td width="121"><a o nclick="dio(001)" href="Downloads/programs/games/bustin'_blox.exe">Bustin' Blox</a></td>
<td width="121"></td>
<tr>
</table>
</center>
</body>
</html>
product_info.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<products>
<download id="001" name="Bustin' Blox" file_size"2 Mb" summary"Our version of Brick. Only One Level (Kinda Sucks)" version="1.0"/>
<download id="002" id="001" name="ASDF" file_size"ASDF" summary"ASDF" version="1.0"/>
</products>
dio.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="SHORTCUT ICON" href="images/logo_orig/info.ico" />
<script src="script.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Product Info</title>
</head>
<body o nload="loadXML(id)" bgcolor="#fffacd" text="#000000" link="FF4500">
<center>
<h1>Product Information</h1>
</center>
<p>
<b><u>File Name: </u></b><span id="name"></span><br />
<b><u>File Size: </u></b><span id="file_size"></span><br />
<b><u>File Summary: </u></b><span id="summary"></span><br />
<b><u>File Version: </u></b><span id="version"></span><br />
</p>
</body>
</html>