ajax 提交數(shù)據(jù)到后臺jsp頁面及頁面跳轉問題
更新時間:2017年01月19日 15:08:57 投稿:lqh
這篇文章主要介紹了ajax 提交數(shù)據(jù)到后臺jsp頁面及頁面跳轉問題的相關資料,需要的朋友可以參考下
ajax 提交數(shù)據(jù)到后臺jsp頁面及頁面跳轉問題
我logincheck.jsp頁面取傳參數(shù)代碼:
String user=request.getParameter("user1");
String pwd=request.getParameter("pwd1");
login.jsp input 取2參數(shù)何用ajax 傳給logincheck.jsp
$.ajax({
type : "POST",
url : baseUrl+"m/module/querymodulebyname.do",
dataType:"json",
data:
{
modName:title
},
success : function(data){
//data = eval('('+data+')');
var result = data.rows[0];
$('#main-tab').tabs('close',title);
openPage(title,'',baseUrl+result.moUrl,null);
}
});
注釋:type:傳輸式使用post
url: 地址數(shù)據(jù)傳輸Struts
data:傳輸參數(shù) modName(自隨便起)action 根據(jù)modname獲取面 title
success:功返參數(shù)data
想要跳轉SUCcess面 跳轉指定頁面
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
您可能感興趣的文章:
相關文章
淺談jQuery中hide和fadeOut的區(qū)別 show和fadeIn的區(qū)別
下面小編就為大家?guī)硪黄獪\談jQuery中hide和fadeOut的區(qū)別 show和fadeIn的區(qū)別。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-08-08
jQuery的Ajax時無響應數(shù)據(jù)的解決方法
今天做項目時發(fā)現(xiàn)永遠響應的值都是該頁面的html代碼。2010-05-05

