JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/south-street/jquery-ui.css">
<div id="leaving-dialog" title="Status">
Hello world
</div>
<a href="http://www.google.com">Google</a>
JavaScript
var targetUrl = $("a").attr("href");
var windowObjectReference;
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";
$("#leaving-dialog").dialog({
buttons: {
"No, I want to stay here": function() {
$(this).dialog("close");
},
"Yes, that's okay": function() {
window.location.href = targetUrl;
windowObjectReference = window.open(targetUrl, "MyWindowName", strWindowFeatures);
}
}
});