我想從Ajax函數中打開一個URL,但URL不被調用。在Ajax函數成功後打開URL
這是我的代碼:
$(document).on("click",".btndriver", function() {
var id = $(this).attr("id");
var nombre = $(this).attr("nombre");
swal({
title: "Select Driver?",
text: "Select Driver? : "+nombre+" ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "GO",
closeOnConfirm: true },
function(){
var value = {
id: id
};
$.ajax(
{
url : "ondemand_driver.php",
type: "POST",
data : value,
success: function() {
window.location(url);
}
});
});
});
有什麼不對呢?
謝謝,但不工作。 – mvasco
_不工作_沒有告訴我很多。你遇到了什麼錯誤? –
我的意思是沒有調用url,讓我看看控制檯。 – mvasco