JS funtion()中URL不跳轉後台action問題

來源:互聯網
上載者:User

標籤:pen   jre   選擇   pre   ++   nbsp   val   請求   preview   

JS funtion()中URL不跳轉後台action問題

今天遇到一個百思不得其解的問題,到現在解決了,但是仍然不知道所以然(估計是因為網域名稱不一致導致的),記錄一下

$.get(actionUrl,
{"parentId":parentId},
function(objResult){
$("#childType").find("option").remove();
$("#childType").append(‘<option value="-1">-請選擇-</option>‘);
var childTypeList = objResult.data;
for(var i=0;i<childTypeList.length;i++){
$("#childType").append("<option value=\"" + childTypeList[i].typeId + "\">"+childTypeList[i].typeName+"</option>");
}

}
);

其中參數“actionUrl”為”lipinka.xxx.com/xxx.action”,而當前此js所在頁面的網域名稱為ka.xxx.com。

現在此js執行時,將不會跳轉至後台進行請求。

將參數”actionUrl”改為”ka.xxx.com/xxx.action”後,再次執行能正常跳轉。

 

參考:http://www.vinsummer.com/article/view/44

JS funtion()中URL不跳轉後台action問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.