JavaScript Tutorial
by Martin TylerApril 7th, 2008I have just added a JavaScript Tutorial to the Liberator documentation page. This is something written mainly by a colleague to help Caplin’s development team, but I felt it could be useful to anyone developing Ajax or Comet applications.
It covers all kinds of aspects of JavaScript programming, mainly focusing on the kind of details that might not be obvious. It includes an interactive section which is useful as you can edit the code and execute it if you want to try out a variation of what is presented.
The page on JavaScript Equality, specifically the == operator, is quite interesting, with a few results you might not expect. It demonstrates that you have to be very careful with the use of the == operator, especially when the values might contain empty strings or arrays.










April 14th, 2008 at 12:31 am
Hi Martin.
Thanx for your tutorial! I’m using comet and the iframe solution.It works great but i’ve a problem…i’m not able to delete the element from the DOM of the iframe page causing the browser memory growth. I tried different javascript solution but nothing…could you help me?Thanx!
April 14th, 2008 at 1:30 am
I think you need to restart the iframe/connection periodically. If I remember right we tried various other ways of cleaning up without reliable success.
April 14th, 2008 at 2:22 am
Thank you Martin,
i’ve thought the same. Could you suggest me a newer and better approach than iframe supported by a tutorial or some code related to learn it?Thanx again
April 14th, 2008 at 2:27 am
Unless you are doing this as technical exercise I would suggest you use one of the existing Comet platforms, like Liberator or one of the other platforms talked about on Comet Daily. Then you dont really need to worry about the transport at all - just use an API and get on with writing an application.
I don’t think you’ll find an actual tutorial telling you how to implement a comet transport - only how to use existing implementations. There are a few posts here talking about how the various transports work however, which might help you if that is really what you are after.
April 14th, 2008 at 3:04 am
I’m not so crazy
! I’ll explain me better! My scenario is the following: i have a complex servlet implementing comet -now running from Tomcat with Nio protocol enabled - that pushes data towards clients.. my only problem is having a client able to interprete what i push and display it in an easy way with good performances and first of all not buffers any data like the iframe does (i’ve to send lots of kbs for long time). I’m obliged to use a servlet bacause it interfaces itself with different java systems…Now i take a look to liberator but if you have new suggestion for me i’ll be glad!Thank you very much
April 14th, 2008 at 5:15 am
Liberator interfaces with Java systems through its DataSource API. So it depends how integrated you need to be - ie whether its ‘app server’ stuff you need to interface to directly, or just other Java systems.