views:

51

answers:

0

I have a javascript function that is called based on user actions on a page. When the user clicks, a javascript function is called that displays a message in a jquery fancybox. This may happen 10,20 or even more times while the user is on the page. This worked fine using simple javascript alerts, but I wanted it to look nicer so I'm using fancybox to format the message box.

This works fine in ff and chrome, but the fancybox only loads the first two times on IE6 and 7, and the first 3 times on IE8. After that, the small, circling loading box appears, but the message never appears.

This is the code in the function that is called by the user click:

$(document).ready(function(){message('test_message')});

These are the fancybox settings and the message function:

var fancybox_settings={'autoDimensions':true, 'hideOnOverlayClick':true , 'hideOnContentClick':true , 'showCloseButton':true,'enableEscapeButton':true ,'autoScale':true};
function message(type){
$("<a id='testing'></a>").attr("href", 'ajax/ajax.Messages.php?type='+type).fancybox(fancybox_settings).appendTo("body").trigger("click").remove();
}

The ajax.Messages.php just defines the text.

I've looked all around, but can't locate any solution to this. Is anyone aware of this problem and is there a solution?