I am developing a javascript file while i will be using as external file in my html. In this js file I want to create an xml object but do not know how to use jquery in here and javascripts functions also do not work here. I have tried below as work around,
var xmlString = "<root></root>";
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(xmlString, "text/xml");
and
var XML = new XMLWriter();
Nothing worked out. I think i'll work when i include like,
But i want to develop external js file independently which is like,
var fs = require('fs');
//// and some other code
/// write this xml to a file
fs.writeFile("GSG_features3.xml", result, function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
//// and some other code
i am executing my script node D:\Work > node myexternaljs.js
How can i achieve this?