Hi all I need a little help here.
I am using a third party control. And with that I am creating lines in my form dynamically through DOM.
The third party ASP/Javascript control uses xml data islands persae(hope that is the right word) to reference the data. Such as what is seen below.
<xml id="xmlAcctCodes" src="getAcctCodes.asp"></xml>
For each new line there is a new control that needs a new xml dataisland created.
So, what I need to do is either create a new XML data island from scratch via javascript or clone one that is already loaded and append it to the body area.
I have tried to do this but have run into issues:
Attempt #1:
This does create the XML node as needed. However, what happens is it is too slow too load. As in by the time it gets to where I am creating and initializing the third party control the XML doc hasn't loaded yet. If I put an alert after this code and wait a few seconds and then click ok to continue it works.
So with this example, I need a way to make it not continue until the XML tag has finished loading the page.
Attempt #2:
Cloning works part way. Except Two things:
1) I can't assign the ID value, which is an issue. I have tried two ways.
2) the insertBefore statement bombs. Telling me that no such interface is supported
Any help at getting this to work is greatly appreciated.
I have to be able to do it this way as I do not have the ability to change the Third party code and the way it works.
Many thanks,
Angela
I am using a third party control. And with that I am creating lines in my form dynamically through DOM.
The third party ASP/Javascript control uses xml data islands persae(hope that is the right word) to reference the data. Such as what is seen below.
<xml id="xmlAcctCodes" src="getAcctCodes.asp"></xml>
For each new line there is a new control that needs a new xml dataisland created.
So, what I need to do is either create a new XML data island from scratch via javascript or clone one that is already loaded and append it to the body area.
I have tried to do this but have run into issues:
Attempt #1:
This does create the XML node as needed. However, what happens is it is too slow too load. As in by the time it gets to where I am creating and initializing the third party control the XML doc hasn't loaded yet. If I put an alert after this code and wait a few seconds and then click ok to continue it works.
So with this example, I need a way to make it not continue until the XML tag has finished loading the page.
Code:
var oXMLAcct;
oXMLAcct = document.createElement("<XML id='xmlAcctCodes" + iLineCount + "' src='getAcctCodes.asp' />");
document.body.insertBefore(oXMLAcct);
Attempt #2:
Cloning works part way. Except Two things:
1) I can't assign the ID value, which is an issue. I have tried two ways.
2) the insertBefore statement bombs. Telling me that no such interface is supported
Code:
var oXMLAcct;
var cCMLAcct = document.getElementById('xmlAcctCodes');
oXMLAcct = cCMLAcct.cloneNode(true);
//Two different way I tried assigning the id
oXMLAcct.id = 'xmlAcctCodes' + iLineCount;
oXMLAcct.documentElement.id = 'xmlAcctCodes' + iLineCount;
//This line bombs. I have also tried appendChild with the same result.
document.body.insertBefore(oXMLAcct);
Any help at getting this to work is greatly appreciated.
I have to be able to do it this way as I do not have the ability to change the Third party code and the way it works.
Many thanks,
Angela