CSSMenuTools Logo
Dreamweaver Extensions Expression Web Addins

Tooltips Advancer - How to use AJAX

How to use AJAX

When using ajax to retrieve content for the tooltips the URL type can be assigned in ToolTip settings section.

Enter URL that returns content of the tooltip.

This may be link to remote text or html document located on remote storage which will be showed in the the tooltip window or link to server-side (php,asp and etc.) script which build content for the tooltip window.

See example php script below.

 

<?php
header('Content-Type: text/plain');

function getContentOfToolTip($id) {
    $content = array(
        'A11111' => 'Info about product A11111 retrieved.',
        'B22222' => 'Info about product B22222 retrieved.',
        'C12345' => 'Info about product C12345 retrieved.'
    );
    
    if ( isset($content[$id]) ) {
        return $content[$id];
    } else {
        return 'No data located matching your request';
    }
}
echo getContentOfToolTip( $_GET['productID'] );
?>

In the above example content for the toolltip builds from the data array. In the real life different data sources like MYSQL may be used.

If URL is /scripts/products-info.php, use the following URL: /scripts/products-info.php?productID=B22222 to show information about product B22222 , and the following URL: /scripts/products-info.php?productID=C12345 to show information about product C12345 and etc.

You can find more information about using AJAX with ToolTip on http://cssmenutools.com.


 

Previous