問題:
? struct 標簽沒有直接與ajax 數據兼容互換方法
解決: 先用struct 動態得到數據?,再利用javascrpit 的 function(this) 把值提取 交給 ajax
需要提交的 struct link 項
<div2>
?????????<html:link????onclick='return action(this)'??????????????????????????//javascript?提交? 參數為 自己標簽?
???????????????????????????????action=""???????????????????????????????????????????????????????//屏蔽?struct 提交 但 用 struct 得到 動態值
???????????????????????????????paramName="tom"
?????????????????????????????? paramProperty="personid"
??????????????????????????????paramId="personnelId">
?????????????????????????????編輯</html:link>
?? <div2/>
<div1/>
js 控制
????????????function?action(obj){
????????????????var?str?=?obj.getAttribute('href');??????????????????
????????????????var?id?=?str.substring(?str.lastIndexOf('=')+1,?str.length?);?????????// 取得 href 中的 的值 (由 struct 得到的 動態值?)
???????????????????var?pars?=?'do=edit&personnelId='+id;
????????????????new?Ajax.Updater('div1','/rlzy/jcyy/basePersonnelList.do?',{parameters:pars,valScripts:true}); //由 prototype 的 ajax 異步提交
????????????????Element.hide(document.getElementById("div2"));
????????????????Element.show(document.getElementById("div1"));
????????????????
????????????????return?false;
????????????}

????????????function?action2(){
????????????????Element.hide(document.getElementById("div1"));
????????????????Element.show(document.getElementById("div2"));
????????????}

????????</SCRIPT>
rlzy/jcyy/basePersonnelList.do? 的頁面? 就局部加入 頁面 div1 了
<INPUT type='button' value="test" onclick="action2();"/>
感想:? javascript 萬能膠水
解決: 先用struct 動態得到數據?,再利用javascrpit 的 function(this) 把值提取 交給 ajax
需要提交的 struct link 項

?????????<html:link????onclick='return action(this)'??????????????????????????//javascript?提交? 參數為 自己標簽?
???????????????????????????????action=""???????????????????????????????????????????????????????//屏蔽?struct 提交 但 用 struct 得到 動態值
???????????????????????????????paramName="tom"
?????????????????????????????? paramProperty="personid"
??????????????????????????????paramId="personnelId">
?????????????????????????????編輯</html:link>
?? <div2/>

js 控制

















rlzy/jcyy/basePersonnelList.do? 的頁面? 就局部加入 頁面 div1 了
<INPUT type='button' value="test" onclick="action2();"/>
感想:? javascript 萬能膠水