General discussion

Locked

Append to XML with JavaScript

By kirtishah ·
I need the code where I can submit a form and append the records into an XML file with javascript. I came across with ASP code but I'm specifically looking for JavaScript code.

Is it possible with JavaScript or do I have to do it with ASP?

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by sachin In reply to Append to XML with JavaSc ...

Hi...
check this code ...it will work... If you get an javascript error ....it will be for a use of activex control in the page .

If you get the above error then only go for
********************
Internet options of your browser
if ie: -> security-> (voices about activeX controls)-> check "Prompt"
When navigating, you will be warned page contains ActiveX, and asked if you want to enable.
Saying "yes" will enable script to run active x control.
**********

Here is the code


<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function XMLHTTPButton_onclick() {
var DataToSend = "id=1";
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST","http://<%=Request.ServerVariables("Server_Name")%>/Receiver.asp",false);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
alert(xmlhttp.responseXML.xml);
}

//-->
</SCRIPT>

<INPUT type="button" value="Submit XMLHTTP" id=XMLHTTPButton name=XMLHTTPButton
LANGUAGE=javascript onclick="return XMLHTTPButton_onclick()">

Collapse -

by kirtishah In reply to

Poster rated this answer.

Collapse -

by kirtishah In reply to Append to XML with JavaSc ...

Point value changed by question poster.

Collapse -

by kirtishah In reply to Append to XML with JavaSc ...

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums