Choose the technology to use in developing 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 like Adobe Flash or Java. However, it is important to emphasize 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, operate 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 case of Snap identifies all links to external pages (or in the internal configuration of the last issue), the TAG <A> for indenderci. 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 by 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, inter alia, JavaScript was introduced in order 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, provides 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 "desktop application" that so much 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 passing parameters):
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? Among the various frameworks and libraries available the initial analysis of the project you want to achieve is of paramount importance. Mistakes at this stage can seriously affect the subsequent stages of any project Web2.0. JavaScript, then, that trumps all when it needs to interact with the DOM.






Latest Comments
GM : Hi, sorry to resurrect an old post but I hope you can give me a hand. How do I, with this method, ...
Giovambattista Fazioli : @ Fabio: a post from the past! I would recommend using the most convenient features of tabs now ...
Fabio : Hello, searching the web I found this article to create your javascript tab strip with php and css, but ...
Miriam : What do you think of Disqus? I am using it and I love it.
Giovambattista Fazioli : @ Nik: I'm happy! Good luck then!