Morfik Tips: How to get browser-side debugging operational
March 20, 2006One of Morfik’s greatest strengths is rapid application development (RAD). One fundamental aspect of any RAD tool is powerful debugging. In a web environment this is usually much more complex than in a traditional fat client (e.g. Windows-) application. Let’s see how we can get it to work.
There are at least three components to debugging in a web environment: client-(browser-) side debugging, server-side debugging, and looking at the communication between the two (and also checking the SQL statements, profiling execution, etc.). If we consider the myriads of technologies and layers on both sides, it is easy to see why web-application debugging is an Achilles’ heel of Web 2.0. This is an area where Morfik promises to deliver break-through technologies: a seamlessly integrated debugging experience from the IDE, that is: since you write both the client and server code in the same language in the same environment, it is just natural to debug both with the same tools in the IDE. This single feature of Morfik will deliver a huge productivity gain setting it apart from the competition.
As of this writing (Release 0.8.5.6 of Morfik WebOS AppBuilder) this is still not finished work. It was a no-brainer to get server-side debugging operational. It just worked out of the box, perfectly.
To get the client-side working was a bit more tricky, though. Here is my experience:
- I was successful with Release 0.8.5.4 and later, not with earlier versions
- Only works with Internet Explorer (it was IE 6.0/WinXP Pro on my machine)
- Download and install the MS Script Debugger. (Although this seems to be an old product, this is what you need.)
- Make sure the “Disable script debugging” option in IE is NOT set (Tools->Internet Options…->Advanced. Turn off the “Disable Script Debugging” checkboxes (there are two of them, one for IE and one for Other). Hit “Apply” then “OK”, or just “OK”.)
- In the Debug tab of the IDE, make sure “Debug Browser” is selected.
- Place a breakpoint in the browser code.
- Run the xApp. Please note that if the color of the breakpoint line changes color to Green at run time, it means it has not been placed in the right location and it will not stop (breakpoints have to be placed within the Begin and End).
At the moment there are some caveats, though:
- The IDE does not see any browser code variables either local or member (xyz = ‘xyz’ in undefined).
- When I exit from a function that was called by the RTL (like a timer event, or a WebFormReady) the app seems to hang.
- I did not run into this issue, but: The MS Script Debugger engine, does not function correctly if .NET or related packages are installed on the same PC! There seems to be some conflicts between the .NET debugger files and those of ActiveX debugger engine.
I’ll cover some more advanced topics in debugging/profiling later.
Thanks to/contributions by: Mike Kerner, Shahram Besharati, Fuad Ta’eed
