SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 55 | Next

Deepak Vohra

"Ajax in Oracle JDeveloper"

3 Installing Prototype
We shall be using the same application that we developed in the previous
chapter and add prototype functionality to the user interface. Download the
latest version of prototype libray1. Copy prototype.js to the public_html
directory of the Ajax project in JDeveloper 11g. The prototype.js file
should be in the same directory as the input.jsp as shown in Fig. 3.1.
1 Prototype Library- http://www.prototypejs.org/
3.4 Configuring Prototype in AJAX Web Application 51
Fig. 3.1 Prototype Application Directory Structure
3.4 Configuring Prototype in AJAX Web Application
In this section we shall add prototype library functions and classes to the
Ajax application input.jsp. To access the prototype.js library add the
following
In the Ajax application version without the prototype library, the
catalogId field is retrieved with get getElementById() function
and the value is retrieved with value attribute.
var
catalogId=document.getElementById(???catalogId???).value;
Retrieve the catalogId value with prototype function $F().
var catalogId=$F('catalogId');
52 3 Less JavaScript with Prototype
In the non-prototype version, the DOM elements are retrieved with
getElementById() function. For example the
validationMessage div is retrieved as follows.
var validationMessage=
document.


Pages:
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67