从cookie中取值:
var userid = $.cookie("remoteuserid");
例子:
function delUser() {
var table = $('#grid-user-list');
var chkBoxes = table.find('input.invechk:checked');
if (chkBoxes.length == 0) {
showMsgPane('请选择需要删除的用户。', 'prompt');
return false;
}
var callback = function() {
var userid = $.cookie("remoteuserid");
var id = new Array();
$(chkBoxes).each(function() {
if(userid == $(this).val()){
showMsgPane('管理员不能删除自己');
return false;
}
else{
id.push($(this).val());
}
});
jQuery.ajaxSettings.traditional = true;
var url=adminPluginPath + "/basic/user/delete.json";
$.post(url,{id:id},function( rtn ) {
refresh();
});
};
showMsgPane('该用户删除后,所有信息将被删除。您确定要删除吗?','confirm', callback);
}