XINS - AJAX Example 2
Description
This page is a demo shows calls to the meta functions of an API that returns HTML by
using the XSLT calling convention.
This example requires the myproject API to run on your computer.
To run the myproject API, go to the demo\xins-project directory and execute xins run-myproject.
Meta functions
Answer:
Answer:
Get Statistics
Hide Statistics
Answer:
Technical explanations
In the explanations _meta_ is the name of the meta function (e.g. _GetVersion).
- When you click on the Get button the Javascript function callMeta(_meta_) is called.
- The callMeta() function, call the XINS API with the _xins-xslt
calling convention. the _template parameter points to
http://xins.sf.net/demo/_meta_.xslt.
- The returned HTML from the XINS call is inserted to the HTML tag
<span id="_meta_"><span> by the Javascript
code document.getElementById(meta).innerHTML = req.responseText;.
- The hide button hides the text by executing the Javascript
document.getElementById(_meta_).innerHTML = ''
You can have a look at the source code of this HTML page to fully understand this example.
XSLT used by this example:
GetVersion,
GetSettings,
GetStatistics.
For security reason, this script works only locally with Internet Explorer or with other
browsers when the HTML page is hosted on the same server as the API.
Prev - Next