Jump to content

I would have got away with it


dooberry

Recommended Posts

:) :)Ok,This is one of the most frustrating things I've ever come across in my brief and amateur history of programming.I have to use the document of an HTA file to save xml documents it's a security setting and I can't change it.What I am trying to do (now using a table because frames don't have the same privileges as the hta file which contains them) is use a table to replicate the behaviour of frames.I know that it's possible to put script into a table cell in the original page content.I cannot for love nor money change a table cell's content to contain script once once the page has been loaded. The innerHTML property changes fine, but excludes any script content.The outerHTML property cannot be changed at runtime (I think because it overwrites the HTML which defines the table cell in the first place and this causes problems with the table).How on this strange blue planet full of wonderful and mysterious creatures do I change the table cell so that it includes script that wasn't there before?here is the code:
<html><script language="javascript">function loadpage(param1, param2){	var xmldoc	var xsldoc	var wpage		xmldoc = new ActiveXObject("Microsoft.XMLDOM")	xsldoc = new ActiveXObject("Microsoft.XMLDOM")		xmldoc.load(param1)	xsldoc.load(param2)		wpage = xmldoc.transformNode(xsldoc)	document.getElementById("formdisplay").innerHTML=wpage}</script><body><table height="100%" width="100%" id="navsystem"><tr ><td width="20%"><html><input type="button" name="showcontact" value="Edit Contact Details" onclick="loadpage('quote.xml','contact.xsl')" /></td><td bgcolor="aaddff" width="80%" rowspan="5" align="center" id="formdisplay"></td></tr><tr><td width="20%">item1</td></tr><tr><td width="20%">item1</td></tr><tr><td width="20%">item1</td></tr><tr><td width="20%">item1</td></tr></table></body></html>

If anyone can help I would really appreciate it. :blink::blink::angry::blink::)

Link to comment
Share on other sites

Dooberry Strikes Again!!:)I've sorted it.What I've done is create the following script in the hta file:

function submitxml(nodeelement, nodevalue, nodedocument){var xmldocvar rootelvar selectednodexmldoc = new ActiveXObject("Microsoft.XMLDOM")xmldoc.async="false"xmldoc.load(nodedocument)rootel = xmldoc.documentElementselectednode = rootel.selectSingleNode(nodeelement)selectednode.text = nodevaluexmldoc.save(nodedocument)}

then in my xsl file, where it defines the input control for the node I have attached this function to the onChange event.

<xsl:template match="hypotheticalnode"><input type="text" id="hyptheticaltextbox" onchange="submitxml('hypotheticalnode',document.getelementbyid('hyptheticaltextbox').value,'hypotheticaldoc.xml')" />

When I then carry out the transform and dump the html in the table cell using the innerHTML property, there is no code and the change event triggers the submitxml() function in the main page -- WOOHOO!!!This will now allow me to edit a document on the client.I'll finish this project and then put the pages on the XML forum for anyone who wants to re-use the code.Dooberry (works very hard!!) :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...