Tag: http status code 405

HTTP错误405.0 – 使用Jquery ajax get不允许使用方法

我正在开发一个用户必须插入用户名的表单。 我想查看用户的用户名有效的模糊: 我添加了这个脚本: 在HTML中: 脚本: function checkUsername(){ var usn = document.getElementsByName(‘username’)[0]; if(usn.value != “”) { var html = $.ajax({ type: “GET”, url: “checkUsername.php?”, data: “usr=” +usr.value async: false, dataType: “text”}).responseText; if(html == “si”) { usn.style.backgroundColor = “green”; } else { usn.style.backgroundColor = “red”; usn.value = “Username still exists!”; } } } 因此onBlur不起作用,当我提交表单时,它看起来像这样的错误: HTTP Error 405.0 […]

jQuery ajax GET返回405 Method Not Allowed

我正在尝试访问需要身份validation的API。 这是我正在使用的代码但我不断收到405 Method Not Allowed错误。 有什么想法吗? (我的用户名和密码是正确的) function basic_auth(user, pass){ var tok = user + ‘:’ + pass; var hash = $.base64.encode(tok); return “Basic ” + hash; } var auth = basic_auth(‘username’,’password’); var releaseName1 = “11.6.3”; var releaseName2 = “11.6.3 Confirmed”; $.ajax({ type: “GET”, url: “https://www10.v1host.com/Company/rest-1.v1/Data/Story?sel=Description,Number,Name,Timebox.Name,Parent,AssetState&where=Custom_Release2.Name='”+releaseName1+”‘,'”+releaseName2+”‘;AssetState=’64′”, beforeSend: function(xhr){ xhr.setRequestHeader(‘Authorization’, auth); }, dataType: “xml”, async: false, […]