facebook

XML file

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #330025 Reply

    Agraffiti
    Member

    So I’ve decided to break the habit of hardcoding things into my webapp and make it more dynamic with xml. I’m trying to load an xml file in the same directory as the main .html file, javascript files, etc. In the custom javascript file, I’ve declared variables “var xmlhttp;” & “var xmlDoc;” outside the functions.(This is a debug layout, not final product) When a button is pressed it runs a function:

    if(window.XMLHttpRequest){
            xmlhttp = new XMLHttpRequest();
        } else{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.open("GET","classes.xml", false);
        xmlhttp.send();
        xmlDoc = xmlhttp.responseXML;

    Another button will run a function:

    if(xmlDoc != null){
            alert(":D");
        }

    However, it does not alert. If I switch the last function to xmlhttp instead of xmlDoc, it does alert. So, at least that’s being declared. I made sure that classes.xml is included in the new “Additional Project Files” property on the main .mobi screen. Any help with xmlDoc == null is appreciated.

    #330138

    Hi Agraffiti,

    We have planned to provide an example for this request. I will provide it tomorrow.

    #330140

    Agraffiti
    Member

    Thanks, I’m showing a demo of my app and code later tomorrow and it would be great if I could have this feature working.

    #330306

    Hi Agraffiti,

    Please take a look at this example. Hope is helpful for you.

    Attachments:
    You must be logged in to view attached files.
    #333675

    Albatros78
    Participant

    Hi Otavio,

    I receive an unsupported form when I try to open your sample with Mobineone 2.0

    Could you repost it to support this version

    Thanks

    #333752

    Hi Albatros78,

    The file format of this example is 2.1.1 you can use the latest product version of mobione to open it, or you can create a new design using the custom.js file on this project, you should add a TextArea and name it as “textArea1” and a button that load the content calling the next function: loadXMLFile();

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: XML file

You must be logged in to post in the forum log in