- Kenya >
- Australia >
- China >
- Sweden >
- Canada >
- New Zealand >
- Chile >
href value automatically adds
ajax=true to the query string, and detects if there are other parameters in it too. The point of this is for you to implement functionality in the receiving page to only deliver desired content when an AJAX call is made, but also that you, with the same URL can return a full page with content if it isn't an AJAX call.
All the links in this demo points to the same URL, but that's only for easier maintenance issues. You can have links with as many different URLs as you desire. ASK functionality is also automatically added to content you've retrieved with ASK. For instance, try the link retrieved in the Show cities-column.
ask.jsinto your page:
target-idOfTargetElement, where "idOfTargetElement" is the ID of the element in the page where you want to present your dynamically retrieved content.
So, an example link using ASK that will present dynamic content in an element named "target" will look like this:
<a href="content.php?continents=true" class="ask target-countries">Get countries</a>
blank.htmfile in your solution in the same folder as the page people will navigate to. Alternatively, you can change this location in the
iframeFakeFileproperty of the
Askobject. This file is needed for history support in Internet Explorer.
You can either download this full demo, with ASP and PHP examples for accessibility, or you can download the
ask.js file (8.3 kb).
Click the links below to see the ASK functionality.