I am trying to simplify the AJAX content in my scripts and started looking into "Sarissa" to help with this.
I am trying to understand how to use updateContentFromURI() and am just not getting any where.
Here is a simple example where all I am trying to do is insert the content of the XML file into the div with id "response".
Obviously it is not working or I would not be posting here. Anyone had success with Sarissa? Any simple examples or suggestions for making this work?
My PHP/HML doc:
<!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" xml:lang="en" lang="en"><head>
<meta name="GENERATOR" content="Quanta Plus">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="../../sarissa.js"> </script>
<script type="text/javascript" src="../../sarissa_dhtml.js"> </script>
<script type="text/javascript">
respdiv = document.getElementById("response");
Sarissa.updateContentFromURI("resp.xml",respdiv);
</script>
</head>
<body>
<div id="response">
</div>
<div id="content">
<p>More stuff.</p>
</div>
</body>
</html>
My XML doc:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE response [
<!ELEMENT response (method,result)>
<!ELEMENT method (#PCDATA)>
<!ELEMENT result (#PCDATA)>
]>
<response>
<method>checkName</method>
<result>1</result>
</response>
Sarissa scripts are installed "../../" relative to both these files.
When I load the page Firefox Error Console shows:
Error: oNode has no properties
Source File: http://localhost/~kurt/sarissa/sarissa.js
Line: 533
Thanks in advance.