從瀏覽器的Localstorage獲取數據,然後將其存儲在Varibale中並將其分配給Ajax調用URL。 下面是我遵循的步驟:將LocalStorage值分配給Ajax稱爲URL
//when document is ready get those DATA from LocalStorage.
var mid = localStorage.getItem('mid');
var id = localStorage.getItem('id');
console.log(mid);//7839
console.log(id);//7698
//At the same time assign it to URL.
$.ajax({
contentType : 'application/json; charset=utf-8',
dataType : 'json',
url:'https://apex.oracle.com/pls/apex/tabularmagic/employees/'+id+'/'+mid,
method : 'GET',
success: function (data) {
//my logic
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log("some error from Customers" +errorThrown+"//"+textStatus);
}
});
,如果你願意,你可以直接調用這個URL: https://apex.oracle.com/pls/apex/tabularmagic/employees/7698/7839
(其中EMPNO = ID和MGR = MID)
問題是我無法將此變量值分配給此URL。 錯誤:500內部服務器錯誤。
的問題解釋還不很清楚,因此很難理解 – charlietfl
好它是什麼需要被添加? –
一個正確和簡潔的問題陳述 – charlietfl