99麻豆久久久国产免费福利精品,国产精品成人国产乱,玖玖操,手机看片169,国产精彩视频在线观看,午夜亚洲福利视频,国产伦乱视频

龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

常用的JS復(fù)制

2015.09.10 | 5閱讀 | 0條評論 | 未命名

1、復(fù)制專題地址和url地址 [php] <input type="button" name="anniu1" onClick='copyToClipBoard()' value="復(fù)制地址"> <script language="javascript"> ?? function copyToClipBoard(){ ??? var clipBoardContent=""; ??? clipBoardContent+=document.title; ??? clipBoardContent+=""; ??? clipBoardContent+=this.location.href; ??? window.clipboardData.setData("Text",clipBoardContent); ??? alert("復(fù)制成功!"); } </script>[/php] ? 2、復(fù)制url地址 [php] <input type="button" name="anniu2" onClick='copyUrl()' value="復(fù)制URL地址"> <script language="javascript"> ?? function copyUrl() ?? { ??? var clipBoardContent=this.location.href; ??? window.clipboardData.setData("Text",clipBoardContent); ??? alert("復(fù)制成功!"); ?? } </script> ?[/php] 3、點(diǎn)擊文本框時,復(fù)制文本框里面的內(nèi)容 [php] <input onclick="oCopy(this)" value="你好.要copy的內(nèi)容!"> <script language="javascript"> function oCopy(obj){ obj.select(); js=obj.createTextRange(); js.execCommand("Copy") alert("復(fù)制成功!"); } </script>[/php] ? 4、復(fù)制文本框或者隱藏域中的內(nèi)容 [php] <script language="javascript"> function CopyUrl(target){ target.value=myimg.value; target.select();?? js=myimg.createTextRange();?? js.execCommand("Copy"); alert("復(fù)制成功!"); } function AddImg(target){ target.value="[IMG]"+myimg.value+"[/ img]"; target.select(); js=target.createTextRange();?? js.execCommand("Copy"); alert("復(fù)制成功!"); } </script> <input name=myimg type=hidden id=myimg value="<a href="http://0597seo.com/">http://0597seo.com</a>" /> <input name=imgurl type=text size=32 value="<a href="http://0597seo.com/">http://0597seo.com</a>" /> <input type=button value="點(diǎn)擊這里復(fù)制本站地址" onclick="CopyUrl(imgurl);" /> [/php] 5、復(fù)制span標(biāo)記中的內(nèi)容 [php] <script type="text/javascript">function copyText(obj)?? { var rng = document.body.createTextRange(); rng.moveToElementText(obj); rng.scrollIntoView(); rng.select(); rng.execCommand("Copy"); rng.collapse(false); alert("復(fù)制成功!"); } </script> [/php] 以下是代碼片段: [php] <br /> <br /> <span id="tbid">http://0597seo.com</span>?? [<a href="#" onclick="copyText(document.all.tbid)">點(diǎn)擊復(fù)制</a>]<br/><br/> <span id="tbid2">http://0597seo.com</span>?? [<a href="#" onclick="copyText(document.all.tbid2)">點(diǎn)擊復(fù)制</a>]<br/><br/> [/php]

贊 (

發(fā)表評論

得荣县| 桐庐县| 潜山县| 宣武区| 墨脱县| 昆山市| 临安市| 东阳市| 化隆| 临沭县| 晋宁县| 万盛区| 德昌县| 吕梁市| 道孚县| 深州市| 宝兴县| 收藏| 海门市| 湖口县| 黎平县| 策勒县| 通榆县| 蒙阴县| 洱源县| 禹城市| 芒康县| 安岳县| 当阳市| 昭平县| 上林县| 无棣县| 遂川县| 泗洪县| 焉耆| 图们市| 仪征市| 翼城县| 聊城市| 诏安县| 三江|