1
我想從我的html文件中調用一個使用javascript的python方法。以下是我的html文件:JavaScript XML-RPC調用沒有執行
<html>
<head>
<title>Gadget</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="xmlrpc.js"></script>
</head>
<body>
<button onclick="call()">Select</button>
<script>
function call() {
$.xmlrpc({
url: 'my_odoo_server',
methodName: 'web_login',
params: ['admin', 'i-011d151e9af5b5588'],
success: function(response, status, jqXHR) {
console.log(response)
},
error: function(jqXHR, status, error) {}
});
}
</script>
</body>
</html>
但是xml-rpc調用並沒有完全執行。請幫忙解決這個問題。
這裏是控制檯圖像。
是否有錯誤? –
我添加了我的控制檯鏡像。請檢查。 –
我的代碼沒有出現任何錯誤。在我的服務器上發送請求,我得到了一個沒有問題的迴應。發送到另一個雖然我得到「訪問控制允許頭」錯誤這是正常的。 「Access-Control-Allow-Headers」是你的問題嗎? – Strahdvonzar