How I can use external JavaScript in my mobile project ? - Forum - Mobile - Progress Community

How I can use external JavaScript in my mobile project ?

 Forum

How I can use external JavaScript in my mobile project ?

  • Hi,

    I'm trying to use external javascript lib (mimic.js) in my mobile project.

    And I found "User-defined resources" in App setting > External resources > User-defined resources

    but when I add my external javascript file into this box and save my project, and then exit from mobile app builder,

    my external javascript file disappear from User-defined resources !

    PS. Have another way to use external javascript in mobile project ?

    Any assistance appreciated.

    Ood.

  • Hello Odd,

    Can you confirm wheather external JavaScript file is added properly or not  from Progress Developer Studio for OpenEdge (PDSOE)? Go to the particular Mobile App from PDSOE and right click on Mobile App and select "Copy source local". After sources are copied to your local file system you can check wheather external java script file entry in the "home.html" file under src node (/src/home.html).

    You can add external java script file from tiggzi in 2 ways:

    1. The one you followed (App setting > External resources > User-defined resources)

    2. Go to Create New > Java Script, you can find two options two add external Java Script resources like "Create from URL" or "Upload from file".

    Hope this helps.

    Regards,

    Sanjeev.

  • Hello Ood,

    I tried adding external JavaScript libraries using the External Resources/User-defined Resources option. The path was not preserved after saving the project.

    Could you contact Technical Support and report this issue?

    As it was mentioned in another post, you can add JavaScript files to your project by creating a new JavaScript component and uploading the file or copying the content into a new file.

    If you need to add JavaScript files from an external location, you can use the following workaround:


    - Add HTML Panel component to your page.

    - Specify HTML code with script tag.

    Example:

      

    I hope this helps.

  • Hello Ood,

    An engineer in my team pointed out that this issue has already been reported.

    Thanks.

  • Hi Sanjeev,

    As your suggestion, I found my external javascript in home.html as below:

    ...

           
           
          
           
    ...

    Additional information: I test call function in mimic with below:

    ...

    var method = "list";
    var request = new XmlRpcRequest("http://:/xmlrpc/db", method);

    alert(after set request");

    var response = request.send();
    alert(response.parseXML());

    ...

    The result is no alert "after set request".

    Thanks,

    Ood.

  • Hi egarcia,

    Yesterday, I request support to Technical Support and waiting for result.

    Thanks,

    Ood.

  • Hi Odd,

    If you are able to see the external java script file entry in the "home.js" file then your file is added succesfully. You are not able to see the external JS file you have added in external resources area because there is a bug already reported for that issue as Edsel mentioned in the other post .

    Regards,

    Sanjeev.