/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to Code Viewer Alt/AJAX/AjaxDemoApp0_getCustomer_description.html

  • Committer: gustav.hartvigsson at gmail
  • Date: 2013-04-04 09:35:11 UTC
  • mfrom: (12.1.2 pvp2)
  • Revision ID: gustav.hartvigsson@gmail.com-20130404093511-gqti3jli2ogy16nv
merged. critial, due to files became missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<span class="description">
 
2
<br>
 
3
<div class="descriptionheading">Overview</div>
 
4
 
 
5
The first application is a small application for testing the customer login functionality of the api. A string is sent to the API and a 
 
6
result set is returned which is parsed using DOM and an alert is shown which contains the firstname and lastname attributes of the customer element that was returned.<br><br>
 
7
 
 
8
<div class="descriptionheading">Showcustomer</div>
 
9
The function called <span class="interestingdescription">showCustomer</span> is executed by the onload event of the body tag. The onload event is useful for things such as greeting screens for customers or adverts as no input is required from the user.
 
10
If combined with <a href="cookies.php">cookies</a> it can be used for a greeting screen such as the greeting from amazon i.e. "Welcome back mr Galafinakis" that does not require user input
 
11
every time the user returns to the site. The <span class="interestingdescription">getCustomer</span> function is part of the AJAX api and it returns the customer data for a certain userID in this case a predefined string containing the customer ID <span class="interestingdescription">"Haakon"</span>.
 
12
<br><br>
 
13
 
 
14
<div class="descriptionheading">ResultCustomer</div>
 
15
 
 
16
The other function <span class="interestingdescription">ResultCustomer</span> is called automatically by jQuery when the data has been returned. 
 
17
 
 
18
<br><br><div class="descriptionheading">getCustomer</div>
 
19
 
 
20
The getcustomer function returns the customer data for a certain customer ID. 
 
21
If the customer ID does not exist, no customer element is returned.
 
22
 
 
23
<br><br>
 
24
 
 
25
<div class='exampleheading'>Function Call Example:<br><br>
 
26
<span class="codeexample">getCustomer(CustomerID,Returnfunction);</span>
 
27
</div>
 
28
 
 
29
<br>
 
30
 
 
31
<br><div class='exampleheading'>Returned Data Example:<br><br>
 
32
 
 
33
<span class="codeexample">
 
34
<pre>
 
35
&lt;customers&gt;
 
36
&lt;customer 
 
37
    id='Haakon'
 
38
    firstname='Jonk'
 
39
    lastname='Triffandelersson'
 
40
    address=''
 
41
    lastvisit=''
 
42
    email=''
 
43
 /&gt;
 
44
&lt;/customers&gt;
 
45
</pre>
 
46
</div>
 
47
 
 
48
</span>