Exercise AJAX and Javascript
Solution
Download the solution to this exercise in a zip file exercise-ajax1.zip.
- index.php, the multiplicator application, makes also addition, substration and division (Source, contains javascript)
- multiply.php (source) the helper ajax function that makes the operation.
- index2.php the application that can call for the creation of a new table (Source, contains javascript)
- generateTable.php (source) the helper ajax function that makes the operation.
Multiplication
Create a small PHP program for multiplying two numbers. It must answer the folowing URL :multiply.php?x=3&y=4 should return a document containing only 7 (you can do this in a Servlet if you want).Write a small html page with two fields and a
button. When the button is pressed, send using AJAX the content of the two fields the your multiplication program and print the result inside a field.
Create a dynamic table
Create a form with two fields:col and ro and one button Create.
You create dynamically (using Javascript) a table containing col columns and ro rows.
Related Pages
Contact
Prof. Dr. Emmanuel Benoist
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Berner Fachhochschule - TI
Quellgasse 21
CH-2501 Biel/Bienne
Switzerland
Mail: emmanuel.benoist (at) bfh.ch
Social Networks
Follow
me
on
Linkedin, Scholar
& Research gate