Ajax/SVG demo

This is a simple demonstration showing how an AJAX script can be called to update the contents of a page.


This demonstration calls an external PHP script which generates SVG patterns based on a classic origami model called the Fujimoto Hydrangea.

You can select the pattern from the "Type" menu.

When you hold down the left mouse button on the + and - buttons, the code adjusts the SVG viewport settings, calls the PHP script using the requested parameters and reloads the generated SVG onto the page.

The "Zoom" value shows the calculated magnification factor.


Here's the JavaScript used to make the AJAX work.

Functions used for zoom events

		

Here's the code used to make the AJAX calls.

Functions used for AJAX calls