Appliweb

All dimensions of your web developments

Affichage des articles marqués javascript

Hello,

I’ve been busy trying to get a prototype working (and learning javascript: It’s very interesting to see how this language evolved compared to Java….)

I have some basic U.I. elements working for the HTML editor, here is a screenshot:

You can see the Toolbar on the right (using jQuery), and you can drag and drop elements from the toolbar to your page.

This is a good progress for now, but the prototype is not ready yet (not even close) for real use.

Anyway, I will soon release it in a forge (I hope http://www.kenai.com) as GPL. I hope some javascript guru will find it enough interesting to take over this part of the Appliweb project.

I try to develop in Javascript (using jquery) the UI editor of Appliweb.

For now, Javascript seems fuzzy logic to me => you can write almost anything with (of course) no compiler errors, you have to run it to check basic mistakes.

Let me show you some examples:


- No error when you call a method with an invalid parameters (just a small warning it seems in IntelliJ IDEA):

I believe it’s because somehow Javascript allows you to  pass parameters not needed ?

- More awkward: You don’t know if your Javascript will run or not.
For example, I add a very simple method in my code. This method is called at a very late stage, and then nothing works !
You get no errors in the editor, no error in firefox nor in Firebug (a great tool for javascript development…), but it seems to blow away everything !
Maybe the information is somewhere in Firebug, but I can’t find it.

UPDATE: Thanks to Raveman comment, you have to enable the console to see the errors. Here is then the error displayed in Firebug:

Much easier to fix now:-)

- Where is my stacktrace ????
In Java, a small error you make in calling a function will fail your program with a big error and a stack trace telling you exactly what where wrong. In Javascript, well, you can see in your browser that there is a problem, but where ?
You have to do some guesswork by setting breakpoints (thanks firebug !) and try to understand what went wrong…..

This is quite disturbing for me poor old Java developer…..

GC.

The Appliweb project will involve lots of Javascript development.

I’m not really a fan of Javascript coding, because:

- I used to do some in 1997-1998, where it was impossible to write javascript compliant with I.E. and Netscape. Even between same versions of I.E. on different desktop you had a different behavior

- No debugger at that time, and very light ones years after.

I really code-as-you-think, so I really need a good debugger to see what’s going on.

I hope that now, years after my previous experiences, I will find some good ones. Here is a list I’ve found:

- FireBug: Waouw, seems to be a great tool, with html and css editor, maybe close to what I would like to do with Appliweb GUI editor. I will try that one first

- Venkman debugger:  I used it in 2005 to fix some hard to find javascript bug in a web application developped in Java Server Faces. It has worked great, but the tool was not pleasant to use.

- Yaldex: Seems only working in Windows, as my development computer is Linux…. It has a free edition though….

- Netbeans: Yep, netbeans, the java IDE. Last version has support for  javascript debugging. As a Java developper I know netbeans well, it’s free, and if the editor/ debugger is ok, maybe I’ll use it. It seems to support debugging under firefox and I.E. A Nice feature for crazy compatibilities issues between these two browsers.

- IntelliJ IDEA: My favourite Java IDE. It now supports javascript debugging too ! I’m sure they’ve done first class support for that, and I would be happy to use it, but it’s not free, and my current company don’t want to buy it…. Too bad really.

Here is a short roundup of the javascript debuggers I stumble upon. If you have any advice (I’m considering myself as a new guy in javascript development), please feel free to insert your remarks. I will test them and give the result in next post….

Bye.

GC.