Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

AJAX - Start Here

16 bytes added, 13:38, 21 October 2014
no edit summary
''AJAX, short for Asynchronous JavaScript And XML, is a group of interrelated Web development techniques used on the client-side (in the browser) to create asynchronous Web applications. ''
''With Ajax, Web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behaviour of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required; JSON is often used instead (see AJAJ), and the requests do not need to be asynchronous.''
''Ajax is not a single technology, but a group of technologies. HTML and CSS can be used in combination to mark up and style information. The DOM is accessed with JavaScript to dynamically display – and allow the user to interact with – the information presented. JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page''
http://en.wikipedia.org/wiki/Ajax_%28programming%29
* It can be used to retrieve real time information for various uses
* It can be used to store data without having to leave the current page.
 
Pure AJAX can be used in bxp software (bxp) however it can be long and complicated to build. To speed things up bxp has a number of pre-built functions already integrated with the security of bxp to allow these functions to work. These functions are only currently available in the bxp forms.
To save a lot of repeating code, the majority of the functionality use the same parameters.
 
All of the functionality is coded into the publicly available library fn_javascript_ajax_campaign.js. https://ww3.allnone.ie/library/javascript/fn_javascript_ajax_campaign.js
bxp creates an array to store the parameters. Not all parameters are being used by all functions.
 
<source lang="javascript">
The AJAX makes calls to the BEAPI, hereto referred to as "The Call". When the Call is made, it requires a username and password. That user must have access to the form. In using the AJAX there are two possible options.
 
# Use a set username and password
# Use a dynamic username and password
The set username and password is more secure but must have specified white listed IP addresses it can be used from. The user must be granted access to the form containing the data. This also allows this user to have all functional access removed but still allow content access. This is the more secure preferred option.
 
* aryAjax_Settings[0] = "client_demo";
* aryAjax_Settings[1] = "demo";
* aryAjax_Settings[2] = "password";
 
Set user location can be difficult to manage if users move location often or there is no static IP address available. There is a dynamic security setting, which requires the current user to have access to the form, but the engine uses the current users login, to access the form.
There is often error messages to display when using the engine for a variety of reasons including: incorrect username, password, IP address restricted, etc.
 
For this reason, it is possible to write back to screen the error messages into a user specified div. You create the div on your form where you like it and put id="" in it.
 
If you set aryAjax_Settings[15] = 'divYourName'; then the error messages will write to the innerHTML of the div.
7,528
edits