The case of James Gosling and the missing Javascript Debuggers
James Gosling recently claimed that: "None of the browsers has decent debugging hooks".
I've got a list of of Javascript debuggers that might be interesting. I think they must use the debugging hooks in Firefox and IE.
- Venkman for Firefox
- Firebug for Firefox (In development)
- MS Visual Studio Express for IE
- MS Script Debugger for IE
- Script Editor for IE
- SplineTech Javascript Debugger for IE (not used it)
- MyEclipse for Firefox
I'm sure there must be something in IntelliJ too, but I don't have a link. Maybe there is something on the cards over at JSEclipse too.
Perhaps James' issue is that the the hooks in FF/IE are not 'decent'? I guess there's also a very good chance that he was misquoted or misunderstood - it wouldn't be the first time a journalist had done that. But if not, it would be good to understand why he discounts this list.
Opera and Safari are conspicuous by their absence. Anyone have any good solutions? And I'm sure there are other debuggers missing.
Which is your favorite?
DWR 2.0 milestone 1 does Reverse Ajax
We've just released DWR version 2.0 milestone 1 - This is probably the biggest release we've ever done in terms of new features.
Reverse Ajax: DWR 1.x allowed you to asynchronously call Java code from Javascript. DWR 2.0 builds on this to allow you to asynchronously call Javascript code from Java. Reverse Ajax makes writing interactive applications much easier. It can use polling or Comet (long-lived HTTP) queries.
Our 'chat' example contains Java code like this:
// Get the current page WebContext wctx = WebContextFactory.get(); String currentPage = wctx.getCurrentPage(); // 'messages' is a List of recent messages for a browser to display // Java objects converted to Javascript have a declaration and a declared variable name. OutboundVariable ov = wctx.toJavascript(messages); // Loop over all the users on the current page for (ScriptSession otherSession : wctx.getScriptSessionsByPage(currentPage)) { otherSession.addScript(ov.getInitCode() ); otherSession.addScript("receiveMessages(" + ov.getAssignCode() + ");" ); // receiveMessages is a Javascript function that displays the current messages }In essence we are looping over all the users on the current page and sending them some Javascript to update their display. The Javascript is even simpler. You just turn polling on:
DWREngine.setPolling(true);Chat example (included in the war download) includes the Javascript source to receiveMessages() which is a 4-liner that uses DWRUtil to put the messages on the screen.
Other uses for this technology include progress bars, online games, stock tickers and any system where server state changes and we need to push updates to a browser or browsers.
Cross-Domain Ajax: We now allow script tag remoting to enable cross-domain Ajax. This is in addition to XMLHttpRequest and iframe remoting.
Automatic signatures Element: If you are using DWR 2.0 with JDK5 generics then you can skip the signatures element in dwr.xml. DWR can now work out the correct mapping all for itself.
DWRUtil Updates: The biggest change is to allow template style DOM manipulation. Using cloneNode() you can create a repeated HTML structure from an array of Javascript data.
Other new features: See the release notes for details of the refactoring to the org.directwebremoting package, new script scope for creators and attributes, and the new call meta-data abilities.
For more information see the detailed release notes, or go straight to the download area.
We've got an aggressive list of new features to add to DWR for the upcoming milestones. What would you like us to add?
Ajax in Content Management Systems
CMS-Watch has just published an article about the use of Ajax in Content Management Systems which I wrote along with Jonathan Downes.
Fundamentally, there are two dimensions to examining Ajax and your content management system:
- Ajax in my CMS Interface
- CMS support for creating Ajax-driven web sites
The article also talks about some of the challenges to web CMS systems:
To claim a big credit for writing it is a bit of a stretch because Jonathan did most of the actual writing.