I added a css class to a link, that when clicked in closes the jquery ui dialog, but I want it to redirect to a page (in a iframe) and also close the dialog.
Currently, if the link has a href value, it just redirects and doesn’t close the dialog. If there is no href value, it closes the dialog as required.
<a href="http://...." class="button hide" target="contentFrame">Some Text</a>
$(".hide").bind("click", function(){
$(".dialog").dialog('close');
});
So I need to somehow perform the closing of the dialog first, and then the redirect.
Can i override the click and do that somehow?
If there is no href value, or its empty, I don’t need to redirect just close the dialog.
You need to manually redirect after closing the dialog box (so you can control the order). Something along the lines of:
remember that you’ll have to
preventDefault()or the link will click like normal. See the jQuery docs for examples and more information.