随笔分类 -  javascript

摘要:code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="ko" lan 阅读全文
posted @ 2020-12-24 00:17 anobscureretreat 阅读(120) 评论(0) 推荐(0) 编辑
摘要:code /* 创建 XMLHttpRequest 对象 */ var xmlHttp; function GetXmlHttpObject(){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari 阅读全文
posted @ 2020-12-24 00:10 anobscureretreat 阅读(624) 评论(0) 推荐(0) 编辑
摘要:code <script type="text/javascript"> // 获取的是一个 如果要获取多个 // document.querySelectorAll(selector) document.querySelector("#btnJson").onclick = function () 阅读全文
posted @ 2020-12-23 23:58 anobscureretreat 阅读(154) 评论(0) 推荐(0) 编辑
摘要:code 1.将string转成json var json={}; var myorderno=$("#myorderno").val(); json.myorderno=myorderno; var jsontext=JSON.stringify(json); 2.将json转成string va 阅读全文
posted @ 2020-08-19 17:48 anobscureretreat 阅读(1468) 评论(0) 推荐(0) 编辑
摘要:code <script type="text/javascript"> $(document).ready(function () { if (window.history && window.history.pushState) { $(window).on('popstate', functi 阅读全文
posted @ 2020-08-19 17:39 anobscureretreat 阅读(168) 评论(0) 推荐(0) 编辑
摘要:code <input type=button value=刷新 οnclick="window.location.reload()"> <input type=button value=前进 οnclick="window.history.go(1)"> <input type=button va 阅读全文
posted @ 2020-08-19 17:38 anobscureretreat 阅读(340) 评论(0) 推荐(0) 编辑
摘要:code <a id="baidu_link" href ="www.baidu.com" title="百度"/> <script type="text/javascript"> function setTitle() { document.getElementById( "baidu_link" 阅读全文
posted @ 2020-08-19 17:36 anobscureretreat 阅读(265) 评论(0) 推荐(0) 编辑
摘要:code if (!/^[1-9]\d?$/g.test(num)){ alert('必须是1-99之间的数字'); return false; } function isCardNo(card) { var reg = /^[1-9]\d?$/; if(reg.test(card) false) 阅读全文
posted @ 2020-08-19 17:31 anobscureretreat 阅读(1153) 评论(0) 推荐(0) 编辑
摘要:code <html> <body> <input onkeydown="if(event.keyCode==13) {test()}"/> <script> function test() { alert(123); } </script> </body> </html> 阅读全文
posted @ 2020-08-19 17:30 anobscureretreat 阅读(1244) 评论(0) 推荐(0) 编辑
摘要:code 对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari: * window.innerHeight 高度 * window.innerWidth 宽度 对于 Internet Explorer 8、7、6、5: * document.docum 阅读全文
posted @ 2020-08-19 17:28 anobscureretreat 阅读(458) 评论(0) 推荐(0) 编辑
摘要:code $('.go-btn').click(function() { window.open( $('#my-dropdown').val(), "_newtab" ); }); code $('.go-btn').click(function() { window.open( $('#my-d 阅读全文
posted @ 2020-08-19 17:26 anobscureretreat 阅读(448) 评论(0) 推荐(0) 编辑
摘要://身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字母x function isCardNo(card) { var reg = /(^\d{15}$)|(^\d{14}(\d|X|x)$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; if(reg.test(card) === false) { ... 阅读全文
posted @ 2019-11-14 11:51 anobscureretreat 阅读(247) 评论(0) 推荐(0) 编辑
摘要:for ( ; ; ) { window.alert(" ∧_∧ ババババ\n( ・ω・)=つ≡つ\n(っ ≡つ=つ\n`/ )\n(ノΠU\n何回閉じても無駄ですよ~ww\nm9(^Д^)プギャー!!\n byソル (@0_Infinity_)") } 阅读全文
posted @ 2019-11-13 12:10 anobscureretreat 阅读(524) 评论(0) 推荐(0) 编辑
摘要:JavaScript分为 ECMAScript,DOM,BOM。 BOM(Browser Object Model)是指浏览器对象模型,它使 JavaScript 有能力与浏览器进行“对话”。DOM (Document Object Model)是指文档对象模型,通过它,可以访问HTML文档的所有元 阅读全文
posted @ 2019-09-27 17:33 anobscureretreat 阅读(215) 评论(0) 推荐(0) 编辑
摘要:navigator是window的子对象 navigator.appName // Web浏览器全称navigator.appVersion // Web浏览器厂商和版本的详细字符串navigator.userAgent // 客户端绝大部分信息navigator.platform // 浏览器运行 阅读全文
posted @ 2019-09-27 17:32 anobscureretreat 阅读(272) 评论(0) 推荐(0) 编辑
摘要:如下实现的是,先将数组反转,然后将第二个元素与倒数第三个元素位置互换 阅读全文
posted @ 2019-09-25 18:55 anobscureretreat 阅读(3488) 评论(0) 推荐(0) 编辑
摘要:var arr=new Array(10,110,34,60,52,65,18,66); var flag=0; for (var i = 0; i < arr.length; i++) { if(arr[i]==66){ console.log(i); flag=1; break; } } if(flag==0){ console.log("66不在该数组中"); } 阅读全文
posted @ 2019-09-25 18:50 anobscureretreat 阅读(2180) 评论(0) 推荐(0) 编辑
摘要:参考: https://www.jb51.net/article/128874.htm https://www.cnblogs.com/stubborn-donkey/p/7248618.html 阅读全文
posted @ 2019-09-14 21:59 anobscureretreat 阅读(4669) 评论(0) 推荐(0) 编辑
摘要:获取select 选中的 text : $("#test").find("option:selected").text(); 获取select选中的 value: $("#test").val(); 获取select选中的索引: $("#test").get(0).selectedindex; 设置select: 设置select 选中的索引: ... 阅读全文
posted @ 2019-09-14 18:57 anobscureretreat 阅读(3041) 评论(0) 推荐(0) 编辑
摘要:使用python解密 参考: https://www.cnblogs.com/songzhixue/p/11253243.html https://www.cnblogs.com/chenglee/p/9037265.html https://www.cnblogs.com/sunyuweb/p/9 阅读全文
posted @ 2019-09-13 22:18 anobscureretreat 阅读(2433) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示