7 Replies Latest reply on Oct 18, 2011 8:34 AM by Sutikshan Dubey

    Is JQuery Supported

      Hi,

      Can we use any javascript library with our HTML5 application.

      I would be required to use REST services, making call to those services and process returned json results, is it possible using Rho Elements?

       

      Thanks & Regards,

      Sutikshan

        • Re: Is JQuery Supported
          James Morley-Smith

          Hi

           

          We have done some testing with JQuery using RhoElements and as far as we can tell it is working.  I would be mindful of how much memory you are using as mobile devices are limited on memory so although the app should run fine, it's probably worth having a look at your usage in case you can do things slightly differently in order to use less RAM (e.g. don't pre-load every page into one page, consider only pre-loading some pages at a time).

           

          REST services, JSON and so on are fine.

           

          James.

          • Re: Is JQuery Supported

            Thanks James.

            I am trying to test if supports jquery. I created small .html file with following content, and copied the [jquery-1.6.2.min.js] at same location. Defined the path to this .html file in Config.xml. When I start RhoElement, it doesn't display anything. Debug mode is true, and logging is also true. I am using MC75A.

             

             

            <!DOCTYPE html>

            <html>

                <head>

                    <title></title>

                      <script src="jquery-1.6.2.min.js"></script>         

                  <script type="text/javascript">

                      $(function () {

                          var text = "<b>Hello World</b>";

                          $(text).appendTo("#div1");

                      });

                    </script>

                </head>

                <body>

                <div id="div1">hi

                </div>   

                </body>

            </html>

             

            Last Message in blog says:

            MEMORY:   Stats: Load=38%  TotalPhy=238312KB  FreePhy=149040KB  TotalVM=32768KB  FreeVM=17408KB 0 2011-10-18 19:25:03

            Is call to REST services possible using plain Javascript like http://www.w3schools.com/ajax/ajax_xmlhttprequest_create.asp

            • Re: Is JQuery Supported
              Robert Galvin

              I tested your simple HTML and it is working fine for me. Are you sure you copied the jquery js file to the same folder as the html file

              Capture.PNG

                • Re: Is JQuery Supported

                  Thanks Rob. Here are the screen shots of my copied files, and Config.xml settings.

                  I am testing using MC75A device. It seems I am missing something basic, as .html without any jquery code, is also not displaying anything for me:( Also attaching the image file of config.xml, is there any mistake. -- Thanks.

                  MC75Folder.png

                   

                  ConfigXML.png

                  Edit- Also I copy pated your exmaple link to my Config.xml startpage, and it worked like charm. Thanks for that but why our own small .html not working..?

                • Re: Is JQuery Supported
                  Robert Galvin

                  Also as far as xmlhttp request you can try an example at: http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html which uses this to load top songs from iTunes. Point RhoElements to this url for a quick test (of course make sure your device is connected)

                  • Re: Is JQuery Supported
                    Robert Galvin

                    The problem you are having is that when the debug=1 is enabled, it displays over your text. See attached updated PartEnquiry.html (I just added some padding). Normally the debug address bar will be off. All of the buttons that RhoElements displays, will be "on top" of the html. So you must be careful of placement.

                    <!DOCTYPE html>
                    <html>
                              <head>
                                        <title></title>
                            
                              </head>
                              <body>
                        <div style="padding-top:40px" id="div1">hi
                        <input type="text"/>
                        </div> 
                              </body>
                    </html>
                    
                    1 of 1 people found this helpful