Web Development

General discussion


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.

Thread display: Collapse - | Expand +

All Comments

Collapse -

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

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.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");


<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

Related Discussions

Related Forums