Nicholas
Nicholas

Reputation: 16056

Can OpenLaszlo Use JavaScript Libraries like JQuery and PrototypeJS?

I have been looking at OpenLaszlo and observed that scripting in the client is implemented in JavaScript. Does this mean it is possible to use libraries like JQuery and PrototypeJS ?

Upvotes: 5

Views: 1064

Answers (3)

raju-bitter
raju-bitter

Reputation: 8996

While you can use any JavaScript library in general with OpenLaszlo, it does not make sense to use jQuery or Prototype in combination with it. OpenLaszlo provides an abstraction layer above the underlying HTML DOM. A 'view' in OpenLaszlo is just a JavaScript object, which contains a sprite container and a corresponding HTML div with CSS styling. The LZX language provides APIs to manipulate the view objects and some APIs for interacting with sprites. View APIs are consistent in both the DHTML/HTML5 and the SWFx runtime, the sprite is a runtime specific implementation. If you assign an ID to a view in OpenLaszlo, the ID will not be attached to the div object representing the view in the application.

This abstraction layer makes it much easier to build rich applications compared to what you have to do with most JavaScript frameworks, but without knowledge of the inner workings of the OpenLaszlo view model it is difficult to integrate other JavaScript frameworks.

Upvotes: 1

David Winslow
David Winslow

Reputation: 8590

jQuery and Prototype rely heavily on the browser's DOM API, not just JavaScript. I am not very familiar with OpenLaszlo, but if it doesn't provide a DOM for manipulating the document to be output, then libraries oriented around abstracting cross-browser DOM incompatibilities will be less useful. Aptana's Jaxer web server claims to allow you to manipulate the DOM before it is sent to the client, even with event listeners and animations. It may be worth a look.

Upvotes: 2

epascarello
epascarello

Reputation: 207531

Directions on using JQuery with other Libraries: http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Upvotes: 2

Related Questions