0
你好,我想重定向到一個URL從一個參數從Ajax響應recived。這裏是我的腳本:Ajax重定向後,提交到一個特定的網址,從參數從AJAX響應收回
<script>
$(function() {
$("button#submit").click(function(){
$.ajax({
type: "POST",
url: "engine/app/insert_user.php",
data: $(\'form#inregistrare\').serialize(),
success: function(data){
if (data == "succes") {
window.location=\'profil.php?user=data\';
}
else {
alert("You have something wrong in your form.");
}
},
error: function(){
alert("failure");
}
});
});
});
</script>
什麼是你的問題? –
我希望把用戶=「響應」 – user3058067
入住這裏Ajax響應 http://stackoverflow.com/questions/4744751/javascript-redirect – Confused