What do I have to do so that when display is clicked the table is refreshed? For now, whenever display is clicked a new table is created underneath the previous one.
When the page loads for the first time I want the whole of the table to be displayed (ie the whole of my XML file(which is linked to an XSL file) underneath the Input fields. How do I do that?
in IE (and not in Firefox) whenever the user clicks on the display button the input section is gone and only the table with the XML content is displayed. How do I get IE to keep the input fields and display the table underneath?
Here is a fragment of my code with all the essential parts hopefully… Thank you in advance!
<html>
.........
......
<script type="text/javascript">
function filterTable(f)
{
................
.......
if (moz)
{
...........
....
var proc = new XSLTProcessor();
proc.importStylesheet(stylesheet);
var resultFragment = proc.transformToFragment(xmlDoc, document);
document.getElementById("target4").appendChild(resultFragment);
}
else if (ie)
{
.....
......
value.setAttribute("select", "books/scifi" + filter);
value2.setAttribute("select", sorter);
document.write(xmlDoc.transformNode(stylesheet));
}
}
</script>
<form>
...........
....
<input type="button" value="Display" onClick="filterTable(this.form)"/>
</form>
<body id="target4">
</body>
</html>
write() will overwrite the whole document, when used after the the document has been loaded. Use another method too to inject the new content, e.g. setting the innerHTML of an element(DOM-methods will not work here, because IE doesn’t allow to move nodes between documents).
Related to the comments:
The markup for the table you get from
You must 1st create an node from this markup: