$( "#dialog-confirm" ).dialog({
resizable: true,
modal: true,
buttons: {
"Yes": function() {
opened = window.open(urlDetail,"Spost","status=1,width=870,height=530");
opened.focus();
$( this ).dialog( "close" );
$.ajax({
url: urlDetail,
type: 'POST',
data: {page_title: proTitle, page_url: proUrl, product_description: proDescription, product_image: proImage, web: proHost, product_price: proPrice, purchased: 'yes' },
})
.done(function() {
console.log("success");
opened=window.open(urlDetail,"ShoppingPost","status=1,width=870,height=530");
opened.focus();
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
},
"No": function() {
opened = window.open(urlDetail,"Spost","status=1,width=870,height=530");
opened.focus();
$( this ).dialog( "close" );
$.ajax({
url: urlDetail,
type: 'POST',
data: {page_title: proTitle, page_url: proUrl, product_description: proDescription, product_image: proImage, web: proHost, product_price: proPrice, purchased: 'no' },
})
.done(function() {
console.log("success");
opened = window.open(urlDetail,"ShoppingPost","status=1,width=870,height=530");
opened.focus();
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
}
}
});