Choose the technology to be used in the development of a Web Application is of vital importance, not to find himself in trouble soon after. The type of web application, its operational characteristics, are the first point to be taken into account to choose the Framework and related technologies.
I have often discussed the effectiveness of JavaScript script against different technologies such as Adobe Flash or Java. However, it is worth pointing out an important aspect often overlooked: access to the DOM. JavaScript, in this case, the candidate (if not the only one) a favorite for this type of operation.
Tools with Snap , for example, work on a simple mechanism: when the HTML page is loaded (and after introduction of the loading of JavaScript scripts) is to scan the page and added a new HTML code at special points. In the specific case of Snap identifies all links to external pages (or internal configuration of the last issue), the TAG <A> for Indentation. These are modified so that on mouse to open a dialog anterpima of links (see this very blog for an example).
Not only snap but many other JavaScript scripts basically do the same thing. Lately, this technique is widely used due to the library Prototype , which provides a variety of methods (such as the famous double-dollar, or $ $ $ - see Prototype: The use of the double dollar sign ($ $) ) is to track that change - the fly - the elements of an HTML page.
Navigating through the HTML DOM is therefore specific task of Javascript. Historically, among other things, Javascript was introduced just to read and write the contents of an HTML page.
For example, if we wanted to make some changes to an HTML page using Adobe Flash, we aggorgeremmo - sooner or later - to be forced to invoke a JavaScript function. The new ActionScript 3.0, for example, offers a class ( ExternalInterface ) suitable for this purpose. – o fscommad() per chiamare una funzione Javascript: Once (in previous versions of ActionScript) we used the command getURL() - now replaced by better flash.net.navigateToURL() - or fscommad() to call a JavaScript function:
1 | ) ; getURL ("javascript: myFunction ()"); |
In addition:
The ExternalInterface class is the External API, an application programming interface That Enables straightforward communication Between ActionScript and the Flash Player container, for example, an HTML page with JavaScript, or a desktop application with Flash Player embedded.
Note that the "desktop application" that so reminds Apollo!
Today, thanks to ExternalInterface , you can invoke a JavaScript function to at least cleaner (this class allows management much more effective than getURL() , such as parameter passing):
1 2 3 4 5 6 | / * Calls the external function "addNumbers" passing two parameters, and Assigning That function's result to the variable "result" * / uint = 3 ; var param1: uint = 3; uint = 7 ; var param2: uint = 7; uint = ExternalInterface . call ( "addNumbers" , param1 , param2 ) ; var result: uint = ExternalInterface . call ("addNumbers", param1, param2); |
1 2 3 4 5 6 | <Script ><!-- / / Adds two numbers, and sends the result back to ActionScript num1 , num2 ) { addNumbers function (num1, num2) { num1 + num2 ) ; return (num1 + num2); } / / --></ Script> |
What can we conclude then? Of all the various frameworks and libraries available the initial analysis of the project you want to achieve is of paramount importance. Failing this stage can seriously affect the subsequent stages of any project Web2.0. JavaScript, then, when you have to win all interact with the DOM.










undolog  »Blog Archive » Where JavaScript wins ...
Choose the technology to be used in the development of a Web Application is of vital importance, not to find himself in trouble soon after. The type of web application, its operational characteristics, are the first point to be taken into CONSIDERATIONS ...