- Overview
- Browser code: WLanguage code or JavaScript code?
- Notes
- Notes about the JavaScript code
WEBDEV allows you to create static pages and dynamic pages. Two types of actions can be programmed in a WEBDEV site: To manage these two types of actions, the code editor of WEBDEV differentiates between two types of code: - Server code (Yellow code in the code editor)
This code is written in WLanguage. This code is run on the server. This code is only available in dynamic pages. - Browser code (green or blue code)
This code is written in WLanguage (green code) or in JavaScript (blue code). When the page is saved, this code is automatically converted to JavaScript and included in the WEBDEV HTML pages. This code is run locally (on the computer of the user) and requires no server action.
Browser code: WLanguage code or JavaScript code? The code run on the computer of the Web user (in the browser) is represented by a green bar or by a blue bar in the code editor. - Green bar = WLanguage: the WL symbol is displayed on the code header.
- Blue bar = JavaScript: the JS symbol is displayed on the code header.
To switch from green code (WLanguage) to blue code (JavaScript), simply click the WL symbol in the code header. Conversely, click JS to switch to WLanguage. We recommend that you develop in WLanguage. Reminder: The browser code is available in the dynamic pages and in the static pages. Notes about the JavaScript code - The processes of controls and pages must contain no prototype: simply write the desired JavaScript code
- The procedures of pages must contain the prototype and the braces required by the JavaScript code
- The procedures of supercontrols must contain the prototype and the braces required the JavaScript code.
Furthermore, the name of the generated JavaScript function must be prefixed by the alias of the supercontrol. - The accesses to the controls must be done via their aliases.
- "_PAGE_" is used to access the form containing the controls of the current page
- Several WLanguage functions can be used to handle the properties and the methods of JavaScript objects in browser code:
| | JSEndEvent | Deletes the association between a WLanguage browser function and an event (implemented by JSEvent). | JSEvent | Associates a browser procedure with an event on an object in browser code. | JSInfoEvent | Used to handle the JavaScript properties of the browser event that triggered the code execution. | JSInterruptEvent | Interrupts the process of current event. | JSMethod | Used to run a JavaScript method on an element found in the current page. | JSProperty | Used to handle specific features on the objects found in the current page. |
|
|
|
|