0
AJAX如何用於在單獨的html頁面上執行代碼?AJAX調用例程不執行
在一個調用頁面我的代碼
$.ajax({
url: 'ajaxcalled2.html', //This is the current doc
type: "POST",
async: 'false',
dataType: 'json',
data: {username: "ABC123", season: "Winter", email: "[email protected]"},
complete: function(response){
console.log(response);
}
});
在所謂的頁面我的代碼:
<html>
<script type="text/javascript">
alert('here');
</script>
</html>
調用頁轉到完整的功能,所以不會出現成爲該頁面的問題
我可以調出被叫頁面,並且警報成功顯示。
但將它們放在一起,不顯示警報。
我錯過了什麼?