随笔分类 -  JavaScript

摘要:<script> document.oncontextmenu = function(){ return false; } document.onkeydown = function(){ if (event.ctrlKey && window.event.keyCode==67){ return 阅读全文
posted @ 2024-09-11 15:53 阅读(10) 评论(0) 推荐(0) 编辑
摘要:第一种: 自己测试时 只适合于input 和textarea 但是针对于其他标签的复制就不能用了。代码如下: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8 阅读全文
posted @ 2019-08-09 20:32 阅读(391) 评论(0) 推荐(0) 编辑
摘要:var url = window.location.href; 阅读全文
posted @ 2019-08-07 15:53 阅读(185) 评论(0) 推荐(0) 编辑
摘要:1、jsonp 2、iframe 3、cors https://segmentfault.com/a/1190000015597029 https://www.cnblogs.com/chenshishuo/p/4919224.html 阅读全文
posted @ 2019-05-19 15:56 阅读(118) 评论(0) 推荐(0) 编辑
摘要:{$banner.title} function copyUrl2() { var Url2=document.getElementById("biao1").innerText; var oInput = document.createElement('input'); oInput.value = Url2; doc... 阅读全文
posted @ 2019-05-06 15:38 阅读(600) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-08-10 21:46 阅读(573) 评论(0) 推荐(0) 编辑
摘要:http://fex.baidu.com/webuploader/ webuploader插件使用分析 https://www.cnblogs.com/Brose/p/webuploader_java.html 记一次WebUploader的使用 https://blog.csdn.net/fore 阅读全文
posted @ 2018-04-17 10:19 阅读(136) 评论(0) 推荐(0) 编辑
摘要:JavaScript(jQuery)中的事件委托 https://www.cnblogs.com/zhoushengxiu/p/5703095.html js中的事件委托或是事件代理详解 https://www.cnblogs.com/liugang-vip/p/5616484.html 阅读全文
posted @ 2018-04-17 08:39 阅读(131) 评论(0) 推荐(0) 编辑
摘要:原文链接:http://www.cnblogs.com/Wayou/p/jquery_plugin_tutorial.html (有部分增删和修改) jQuery插件开发模式 软件开发过程中是需要一定的设计模式来指导开发的,有了模式,我们就能更好地组织我们的代码,并且从这些前人总结出来的模式中学到很 阅读全文
posted @ 2017-10-22 19:46 阅读(261) 评论(0) 推荐(0) 编辑
摘要:原文:http://javascriptissexy.com/ 翻译:http://blog.csdn.net/luoweifu/article/details/41466537 【建议阅读原文,以下为个人学习笔记,有部分知识点补充,不喜勿喷】 在JavaScrip中,function是内置的类对象 阅读全文
posted @ 2017-10-19 11:03 阅读(401) 评论(0) 推荐(0) 编辑
摘要:1、将jQuery转换为dom对象的方法 [index] 或者.get(index): a、$(“#form”)[index] ,该方法获取form元素的dom对象 b、$(“#form”).get(index) 2、将js的dom对象转换为jQuery对象,对于已经是一个DOM对象,只需要用$() 阅读全文
posted @ 2017-10-17 16:31 阅读(2800) 评论(0) 推荐(0) 编辑
摘要:第一种方法: 用计时器,设定一个和动画时长一样的time,过time事件去执行这个函数。 setTimeout(function(){ },time); 第二种方法: 当-webkit-animation动画结束时有一个webkitAnimationEnd事件,只要监听这个事件就可以了。 不同浏览器 阅读全文
posted @ 2017-10-17 15:53 阅读(11638) 评论(0) 推荐(0) 编辑
摘要:Javascript: IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度document.documentElement.clientWidth ==> 可见区域宽度document.d 阅读全文
posted @ 2017-08-23 16:38 阅读(213) 评论(0) 推荐(0) 编辑
摘要:var iframe = document.createElement("iframe"); iframe.src = "http://www.baidu.com/"; if (!/*@cc_on!@*/0) { //if not IE iframe.onload = function(){ alert("框架加载完毕."); }; } else { i... 阅读全文
posted @ 2017-08-11 11:33 阅读(10484) 评论(0) 推荐(0) 编辑
摘要:Document 阅读全文
posted @ 2017-08-10 14:53 阅读(195) 评论(0) 推荐(0) 编辑
摘要:1.验证用户名和密码:("^[a-zA-Z]\w{5,15}$")正确格式:"[A-Z][a-z]_[0-9]"组成,并且第一个字必须为字母6~16位;2.验证电话号码:("^(\d{3,4}-)\d{7,8}$")正确格式:xxx/xxxx-xxxxxxx/xxxxxxxx;3.验证手机号码:"^ 阅读全文
posted @ 2017-07-26 13:21 阅读(504) 评论(0) 推荐(0) 编辑
摘要:获取信息窗口的信息 阅读全文
posted @ 2017-06-23 17:18 阅读(5769) 评论(0) 推荐(0) 编辑
摘要:按F12打开调试窗口,切换到Sources选项卡,最右边的Event Listener Breakpoints里勾选Mouse下的mouseover即可,当鼠标移动到图片上时触发mouseover事件,chrome可响应事件设置断点,跟踪js代码查看就可以。 阅读全文
posted @ 2017-06-22 16:27 阅读(2906) 评论(0) 推荐(1) 编辑
摘要:1、浏览器遇到js代码会暂停页面的下载和渲染,谁晓得js代码会不会把html给强奸(改变)了; 2、延迟脚本加载:defer 属性 不支持 defer 属性的浏览器的弹出顺序是:“defer”、“script”、“load”。而在支持 defer 属性的浏览器上,弹出的顺序则是:“script”、“ 阅读全文
posted @ 2017-04-16 16:56 阅读(186) 评论(0) 推荐(0) 编辑
摘要:PC端网站跳转手机端网站 阅读全文
posted @ 2017-04-15 08:42 阅读(612) 评论(0) 推荐(0) 编辑

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