网页中直接复制的源代码

 
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" />
< title >欢迎光临赵庆贝博客 </title>
</head>

< body >
< script language ="javascript" type ="text/javascript" >
function MM_findObj(n, d) { //v4.0
    var p,i,x;    if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function JM_cc(ob){
  var obj=MM_findObj(ob); if (obj) {    
  obj.select();js=obj.createTextRange();js.execCommand("Copy");}
  alert("已经成功复制地址,你可以把地址发给你朋友或贴到其他网页里啦!");
}
</script>

< script language ="javaScript" >document.write(' < input name ="page_url" value ="'+window.location.href+'" style ="width:468px; color:#555555; border: 1px solid #D5D5D5" > < input type ="button" name ="Button" value ="复制本页地址" onClick=JM_cc("page_url") style ="width:100px;height:19px;color:#555555;border: 1px solid #D5D5D5; background-color: #FFFFFF" >'); </script> < br > < span id ="tjtext" >复制本页地址推荐给你的朋友,共享精彩! </span>
</body>
</html>
以上为赵庆贝个人所得,下面是源代码,有兴趣者请下载。欢迎光临赵庆贝博客。

本文出自 “赵庆贝” 博客,谢绝转载!

你可能感兴趣的:(java,Web,职场,源代码,休闲)