How to convert code from PHP to JScript?

  • Thread starter Thread starter ArkaneArkade
  • Start date Start date
A

ArkaneArkade

Guest
I'm working on a script for Messenger Plus, which uses a version of JScript. The end result is to save an XML file, which is working quite successfully, except that the end file is just one very long line with all the nodes one after another.

I've done this before in PHP, and am able to use the DOM to make a nice, elegant format of XML using $doc->formatOutput=true;
I've also been told that XMLSerializer().serializeToString(doc); would be the equivalent in JavaScript. Can anyone tell me how I would do this in JScript?
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Sadly there is no way to do this with JS, but you can use a half-way solution.

As you already know you can make the XML formatted with PHP, so create a PHP script where you will pass the file location and name as a parameter and make it convert the file. In the JS script do a AJAX call with the parameters to request the PHP script to format the file.

This should take care of the problem of the file not being formated, but it will surely add a bit of more time in the final result.
 
Back
Top