Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    ArkaneArkade
    ArkaneArkade's Avatar
    Guest

    How to convert code from PHP to JScript?

    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?

  2. #2
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

  3. #3
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

  4. #4
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

  5. #5
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

  6. #6
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

  7. #7
    cristianods's Avatar
    Junior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    26
    Downloads
    0
    Uploads
    0
    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.

 

 

Quick Reply Quick Reply

Click here to log in


In what corner do we have Search box?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP code to convert ü to ü?
    By oury in forum Discuss PHP
    Replies: 0
    Last Post: 03-30-2010, 07:31 PM
  2. Can someone please convert this java code to php?
    By Andy P in forum Discuss PHP
    Replies: 0
    Last Post: 01-12-2010, 01:21 PM
  3. Can you convert this C# code to PHP?
    By Craigus in forum Discuss PHP
    Replies: 0
    Last Post: 04-22-2009, 01:35 AM
  4. Convert PHP code to ASP code?
    By shiva0101 m in forum Discuss PHP
    Replies: 0
    Last Post: 04-05-2009, 01:33 PM
  5. How do I convert this php code to HTML?
    By HomeAndFamily.biz in forum Discuss PHP
    Replies: 2
    Last Post: 02-17-2009, 12:39 AM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •