In your case, you need a slight delay between mouseover and AJAX request. Start by executing setTimeout for an AJAX request. If another prompt is issued during this timeout, clear the timeout and set a new timeout.
Here is a simplified version (assuming you use the same cell_onmouseover function as a handler for all elements.
var timeoutId = null;
function cell_onmouseover()
{
if (timeoutId)
{
clearTimeout(timeoutId);
timeoutId = null;
}
timeoutId = setTimeout(callAJAX, 500);
}
function callAJAX()
{
}
[Edit]: You can also improve this to interrupt an incoming AJAX call when users hover over a new item.
source
share