jQuery UI dialog

<script type="text/javascript">
jQuery(function($){
	$("#dialog").dialog({
		autoOpen: false,
		modal: true
	});
});
 
$(".confirm-link").click(function(e) {
	e.preventDefault();
	var targetUrl = $(this).attr("href");
 
	$("#dialog").dialog({
		buttons : {
			"Confirm" : function() {
				window.location.href = targetUrl;
			},
			"Cancel" : function() {
				$(this).dialog("close");
			}
		}
	});
 
	$("#dialog").dialog("open");
});
</script>
<div id="dialog" title="Confirmation Required">
    Are you sure about this?
</div>
 
<a class="confirm-link" href="http://www.google.com/">Click here to go to google with confirmation</a>
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">