Thursday, 19 September 2013

jQuery dialog box opens on click, but autoOpen not working

jQuery dialog box opens on click, but autoOpen not working

I have a site here...
When you arrive at the site...
autoOpen: true, is working, but it's not loading the ajax request
(jquery-ajax.html).
But, if you click the button at the top-left, that says "Compliance &
Ethics", then the ajax request goes through and opens the dialog.
What am I doing wrong, that it doesn't autoOpen properly?
$(function() {
$("#dialog").dialog({
autoOpen: true,
modal: true,
width: 750,
height: 'auto',
show: 'fade',
hide: 'fade',
position: {my: "center top", at:"center top", of: window },
buttons: {
"Dismiss": function() {
$(this).dialog("close");
}
}
});
Here's what calls the ajax request on click...
<script type="text/javascript">
jQuery('#dialog').load('jquery-ajax.html').dialog('open');
</script>

No comments:

Post a Comment