Problems with Javascript

I am using the Alpha 5 Framework and trying to develop an few pages for a proof of concept that will work on a MC9190. I made a page in Alpha 5 that has an inventory search which uses ajax callbacks to load the data to the page. It works in my Android webkit browser but the javascript crashes in Rho Elements. How do I find what lines of Javascript code are crashing it? Is there a debug mode?

Edit: I found the debug mode and this is the error that I am receiving when I try to perform an ajax callback using my framework. Any idea where to look for further details?

ERROR: Engine ConsoleLog Error: Error calling method on NPObject., line 0: undefined  0 2009-01-02 22:26:55

Robin West
Hi JasonI think I know what

Hi Jason

I think I know what is going on here. Within the a5.js script it has the following line.

getTransport:function(){if(window.ActiveXObject)returnnewActiveXObject('Microsoft.XMLHTTP');elseif(window.XMLHttpRequest)returnnewXMLHttpRequest();else return false;}

Because we have implemented the ActiveXObject for backward compatibility with PocketBrowser, It tries to create a 'Microsoft.XMLHTTP' ActiveX object and it can't. You really want it to execute the

newXMLHttpRequest().

To work around this rename the npwtg_legacy.dll (found in \program files\rhoelements\NPAPI) to something not ending in .DLL. This will effectively not load this library when RhoElements starts up. Or Change the line to check for window.XMLHttpRequest first. The later may be better if you are trying to run on Et1. As ET1 is Android, you don;t have access to the NPAPI folder to remove the npWTG_legacy.dll

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jason Beneteau
Rob,Thanks for figuring it

Rob,

Thanks for figuring it out. My Ajax works beautifully now. Do you think it is possible to add a switch to the Rho Elements config to turn off legacy code?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
You can set all the

You can set all the <PreloadLegacyXXX> values to 0 in the configuration file.  You must set them all to 0, we have a known issue where setting them individually will not work.  So you have:

<Preloads>

          <PreloadLegacyGeneric VALUE="0"/>

          <PreloadLegacyODAX    VALUE="0"/>

          <PreloadLegacyNoSIP   VALUE="0"/>

          <PreloadLegacyAirBeam VALUE="0"/>

          <PreloadLegacyAPD     VALUE="0"/>

          <PreloadJSObjects     VALUE="1"/>

        </Preloads>

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Jason Beneteau
I'm still trying to figure

I'm still trying to figure this out but I cannot get past the error on NPObject. Does this have to do with security in Rho Elements?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
Jason Can you send me a

Jason

Can you send me a private message with the details for connecting to the page you are talking about? Have you tried any of the example Alpha 5 samples?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
JasonI think you may have had

Jason

I think you may have had the slashes going the wrong way in your .LNK file.

Here is a shortcut file I created to launch a demo Alpha5 app on their site:

87#"\Program Files\RhoElements\RhoElements.exe" /S:http://demo.alphasoftware.com/grids.a5w

You may also want to change the config.xml so that you can actually type in an address in a address bar to make sure you have the URL correct:

<DebugButtonsEnabled value="1" />

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robin West
The demo website has a very

The demo website has a very similar ajax callback that is getting the same NPObject error.

The url is

http://demo.alphasoftware.com/AJAX_UnderstandingTheBasics.a5w

If you type inside the textbox and press submit, it will do an ajax callback and return javascript which is then run in the browser. In this demo, the javascript does an innerHTML to say "Hello <textbox input>, Today is <current date/time>".

I've tested this demo in mobile browsers Android 2.3.7 and Windows CE 6 IE and it works. It does not work in Rho Elements 1.0.2.3

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
Hi JasonAre you trying to run

Hi Jason

Are you trying to run these from the local file system or from a remote web server. If it is the local files system, the security settings for AJAX does not allow this, luckily we have addressed this in the latest release by including a built in web server.

By default the local web server is switched off, you will need to manually enable and configure the server using the RhoElements configuration file. See the Configuration Settings help page for the server options, specifically those under the <WebServer> hierarchy.

Using the following example configuration:

  • Enabled: 1
  • Port: 8080
  • WebFolder: \myWeb
  • Public: 0

Navigating to file://\myWeb\index.htm will load the page from the file system.

Navigating to http://localhost:8080/index.htm will load the same page via the local web server.

This should resolve your ajax problem. If you want to also post a sample along with the Config.xml file, I can take a look.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jason Beneteau
Thank you for your reply,I am

Thank you for your reply,

I am running the page on a remote web server. I made an icon like in the youtube video, "RhoElements path..." /S:xxx.xxx.xxx.xxx/test.a5w . where xxx is the IP address of my webserver. When I google NPObject errors all I see is security and cross domain problems with Flash/Silverlight/Java. I don't have any plugins just HTML, CSS, Javascript.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments