/**
* 获取网页复制动作
* οncοpy="getCopyLog(this,position)"
* @param string text
*/
function getCopyLog(res,position){
//<script type="text/javascript" src="public/zt/zt.js"></script>
if(window.getSelection){
var thisVal = window.getSelection();
}else{
var thisVal = document.selection.createRange().text;
}
var res = $(res).text();
var res = $.trim(res);
if(res != $.trim(thisVal))return;
var position = $.trim(position);
var pre = window.location.pathname;
pre = pre.match(/^\/zt-([a-zA-Z0-9_]+)(\.html|\s*|\.html?.*|\.\s*|\.h\s*|\.ht\s*|\.htm\s*)$/);
pre = pre[0];
if(pre.indexOf('.') != -1){
pre = pre.split('.');
pre = pre[0];
}
pre = pre + '.html';
var host = window.location.host+pre;
var url = '/special/getCopyLog';
$.post(url,{'position':position,'host':host},function(res){
if(res.code == 0)return true;
else alert('数据保存失败');
})
}
* 获取网页复制动作
* οncοpy="getCopyLog(this,position)"
* @param string text
*/
function getCopyLog(res,position){
//<script type="text/javascript" src="public/zt/zt.js"></script>
if(window.getSelection){
var thisVal = window.getSelection();
}else{
var thisVal = document.selection.createRange().text;
}
var res = $(res).text();
var res = $.trim(res);
if(res != $.trim(thisVal))return;
var position = $.trim(position);
var pre = window.location.pathname;
pre = pre.match(/^\/zt-([a-zA-Z0-9_]+)(\.html|\s*|\.html?.*|\.\s*|\.h\s*|\.ht\s*|\.htm\s*)$/);
pre = pre[0];
if(pre.indexOf('.') != -1){
pre = pre.split('.');
pre = pre[0];
}
pre = pre + '.html';
var host = window.location.host+pre;
var url = '/special/getCopyLog';
$.post(url,{'position':position,'host':host},function(res){
if(res.code == 0)return true;
else alert('数据保存失败');
})
}