5 Replies Latest reply on Jan 17, 2010 5:04 PM by Joe ... Ward

    Javascript Support?


      I am developing an Air application which must be able to open a webpage using the <mx:HTML> but the webpage I want to open has Javascript inside it and the HTML browser in AIR doesn't support Javascript, forget to mention that the webpage is owned by another company (its public webpage) so I can't modify any thing on it,

        • 1. Re: Javascript Support?
          Joe ... Ward Level 4

          The mx:HTML control does support Javascript. There are some things like calls to eval() that are restricted in the application security sandbox. If you can't modify the code, you will have to load the page in a different security sandbox. If you are loading the page from the internet this will happen automatically.

          • 2. Re: Javascript Support?
            mawni1980 Level 1

            Thanks Joe,


            Can you please introduce the method to open javascript from internet in HTML page inside AIR applications, forget to mention that the page I am trying to open is BIRT reporting

            • 3. Re: Javascript Support?
              Joe ... Ward Level 4

              Running remote Javascript with full system privileges is not safe, so it is not allowed.


              If I understand your issue, you have two options:

              1. Make the Javascript in question part of your installed application (so it is no longer loaded from a remote source).

              2. Code up a sandbox bridge interface so that your application code can communicate safely with the remote Javascript.


              See http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08. html for more information on option 2.

              • 4. Re: Javascript Support?
                mawni1980 Level 1

                Thanks Very Very Much Joe, its really nice to find someone reply to my question, I really appreciate it..


                I will do my best to describe the problem


                I am developing a windows application to handle reports from BIRT Reporting, (because Adobe AIR doesn't support Group By, Sort, Filtering,....) so the reporting will be BIRT Reporting that is built on Eclipse, I ask for the report from BIRT through Remote Object, I get the report as URL, this URL opens into HTML Windows inside Flex application, from here, I am facing the following problems:

                1. The BIRT Reports has actions bar built on javascript (Print, Filter, Sort, Group,....): these buttons wasn't working, I managed them to work from HTML Iframe.

                2. When I request Print, The Print Preview opens in new HTML page, (I had trouble to get popUp) but managed it through IFRAME and sandboxroot

                3. The only standing problem right now is: Printing the report that opens in new HTML page from my Air application, I don't want to print it through Flex Print Job, I want it to be printed using window.print() from the javascript code???


                Do you have any suggestions??!


                Thanks IN advance!

                • 5. Re: Javascript Support?
                  Joe ... Ward Level 4

                  The window.print() method isn't supported.  And, frankly, printing content that's displayed in the HTML control doesn't work very well, either.