Tooltip Content via Ajax

This example of dyn-web's Tooltips demonstrates and describes how to obtain content using ajax. Hover over the links below to see.

Link one, link two and link three.

This example demonstrates using a value in a query string (prodID) to look up product information in a database[1] and return a string to display in the tooltip .

Instructions

Tooltip links for this demo are set up as follows:

<a href="products.php?prodID=j1">Link one</a>

When using ajax to retrieve content for the tooltips by passing a value in the query string, you set up the defaultProps as shown below. The variable name supplied in the query string could be any value you choose. It would be supplied in the queryVal property:

dw_Tooltip.defaultProps = {
    content_source: 'ajax',
    actuatorQual: 'queryVal',
    queryVal: 'prodID'
}

You may view the JavaScript file containing the ajax code for the tooltip. The ajax demo is provided in a download file, separate from the other example documents.

More Information

See Documentation for basic instructions as well as more detailed information about advanced features of the code. The download file contains numerous examples to simplify the process of implementation for you. See the list of examples in the right column to see other features demonstrated.

See Licensing Information for use of the code. Please read dyn-web's Terms of Use if you plan to use our code.


  1. Since we don't have a database of products set up we will just look it up in an array for this demo. ^