I use jQuery UI Tooltip Widget and there is code:
$(function() {$( document ).tooltip({
content: \'connecting\',
content:function(callback) {
First you tag your links with a class
Alex Brown
John Black
Then hook your tooltips on that class
$(function() {$( ".teacher-link" ).tooltip({
content: 'connecting',
content:function(callback) {
var link = $(this).attr("data-teacher"); // here retrieve the id of the teacher
$.get('teacher.php?teacherid=' + link,{}, function(data) {
callback(data);
});
},
})});
On non html5 page you can use another attribute like title:
var link = $(this).attr("title"); // here retrieve the id of the teacher