I'm trying to do a dialog with jQueryUI, but actually when I'm clicking on a link to open it, it generate some divs, and if I'm clicking a second time, the dialog appears.
EDIT : The "click" is an HyperLink that call a JS method (that handle my code), generated by a webobject (Apple WebObjects)
I'd like to open the dialog at the first click.
Here are the differents codes :
HTML before first click:
<div id="theDialog">Hello</div>
HTML after the first click:
<div tabindex="-1" role="dialog" style="display: none;" class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-draggable ui-resizable" aria-describedby="theDialog" aria-labelledby="ui-id-1">
<div class="ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix ui-draggable-handle">
<span id="ui-id-1" class="ui-dialog-title"> </span>
<button type="button" class="ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close" title="Close">
<span class="ui-button-icon ui-icon ui-icon-closethick"></span>
<span class="ui-button-icon-space"> </span>Close</button>
</div>
<div id="theDialog" class="ui-dialog-content ui-widget-content">Hello</div>
</div>
My script:
$("#theDialog").dialog().dialog('open');
This script gives me an error by the way (Syntax error, unrecognized expression: ,)
I've tried many possibilities before this script, like this post (Jquery dialog won't open) but actually I've always the same problem or an error in the console...
Many thanks in advance for any help