我有這個代碼,並在成功後,謝謝頁面出現。 代碼執行但仍保留在同一頁面上,不會重定向到謝謝頁面。爲什麼謝謝頁面不出現
<a id="ajaxpost" class="large red button round" href="javascript:void(0)">לחץ כאן<a>
<script>
$("#ajaxpost").click(function() {
$.ajax({
type: 'POST',
data: $('#newsletter').serialize(),
url: 'http://www.stress-free-life.co.il/lists/?p=subscribe&id=1',
success: function (msg) {
openWin();
$('#Name').val('');
$('#email').val('');
window.location = "www.bkalut.co.il/thankyou.html";
},
failure: function (msg) {
alert('Sorry, we were unable to process your subscription.');
}
});
});
你在得到什麼錯誤安慰? – V31
你可以調試,如果在腳本 – Se0ng11
有任何錯誤,也請考慮修復您的問題... – nonchip