將要傳送的參數包入onclick的方法


在onclick的指令下,要塞更多的資料到執行的function方法

方法一:
全部包入rel,然後使用如@來做分隔符號,接過去之後,再做分拆取得


方法二:
使用JavaScript的方法取得
'<td><a href="#" onclick="CoinBuyLogButton(this)" 
Nickname= "' + Nickname + '" 
id="' + data.MemberBalances[i].Userid + '">' 
+ CoinsBuy + '</a></td>'

var Nickname = tag.getAttribute('Nickname');
var id = tag.getAttribute('id');

方法三:
使用JQuery的方法取得
'<div class=" button aquamarine" style="padding-right: 20px;">
<span><a onclick="popContent2(this)"
_type = "'+$obj.ReplayRecordType+'" ; 
_title="'+$obj.ReplayRecordTitle+'" ; 
_Content ="'+$obj.ReplayRecordContent+'">檢視</a></span></div>';

var _type = $(data).attr("_type");
var _title = $(data).attr("_title");

留言

這個網誌中的熱門文章

jQuery獲取Select選擇的Text和Value(轉)

Android 在Fragment下控制輸入鍵盤

彈跳視窗iframe的運用