随笔分类 - JavaScript
摘要:<script> document.oncontextmenu = function(){ return false; } document.onkeydown = function(){ if (event.ctrlKey && window.event.keyCode==67){ return
阅读全文
摘要:第一种: 自己测试时 只适合于input 和textarea 但是针对于其他标签的复制就不能用了。代码如下: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8
阅读全文
摘要:var url = window.location.href;
阅读全文
摘要:1、jsonp 2、iframe 3、cors https://segmentfault.com/a/1190000015597029 https://www.cnblogs.com/chenshishuo/p/4919224.html
阅读全文
摘要:{$banner.title} function copyUrl2() { var Url2=document.getElementById("biao1").innerText; var oInput = document.createElement('input'); oInput.value = Url2; doc...
阅读全文
摘要:http://fex.baidu.com/webuploader/ webuploader插件使用分析 https://www.cnblogs.com/Brose/p/webuploader_java.html 记一次WebUploader的使用 https://blog.csdn.net/fore
阅读全文
摘要:JavaScript(jQuery)中的事件委托 https://www.cnblogs.com/zhoushengxiu/p/5703095.html js中的事件委托或是事件代理详解 https://www.cnblogs.com/liugang-vip/p/5616484.html
阅读全文
摘要:原文链接:http://www.cnblogs.com/Wayou/p/jquery_plugin_tutorial.html (有部分增删和修改) jQuery插件开发模式 软件开发过程中是需要一定的设计模式来指导开发的,有了模式,我们就能更好地组织我们的代码,并且从这些前人总结出来的模式中学到很
阅读全文
摘要:原文:http://javascriptissexy.com/ 翻译:http://blog.csdn.net/luoweifu/article/details/41466537 【建议阅读原文,以下为个人学习笔记,有部分知识点补充,不喜勿喷】 在JavaScrip中,function是内置的类对象
阅读全文
摘要:1、将jQuery转换为dom对象的方法 [index] 或者.get(index): a、$(“#form”)[index] ,该方法获取form元素的dom对象 b、$(“#form”).get(index) 2、将js的dom对象转换为jQuery对象,对于已经是一个DOM对象,只需要用$()
阅读全文
摘要:第一种方法: 用计时器,设定一个和动画时长一样的time,过time事件去执行这个函数。 setTimeout(function(){ },time); 第二种方法: 当-webkit-animation动画结束时有一个webkitAnimationEnd事件,只要监听这个事件就可以了。 不同浏览器
阅读全文
摘要:Javascript: IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度document.documentElement.clientWidth ==> 可见区域宽度document.d
阅读全文
摘要:var iframe = document.createElement("iframe"); iframe.src = "http://www.baidu.com/"; if (!/*@cc_on!@*/0) { //if not IE iframe.onload = function(){ alert("框架加载完毕."); }; } else { i...
阅读全文
摘要: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.验证手机号码:"^
阅读全文
摘要:按F12打开调试窗口,切换到Sources选项卡,最右边的Event Listener Breakpoints里勾选Mouse下的mouseover即可,当鼠标移动到图片上时触发mouseover事件,chrome可响应事件设置断点,跟踪js代码查看就可以。
阅读全文
摘要:1、浏览器遇到js代码会暂停页面的下载和渲染,谁晓得js代码会不会把html给强奸(改变)了; 2、延迟脚本加载:defer 属性 不支持 defer 属性的浏览器的弹出顺序是:“defer”、“script”、“load”。而在支持 defer 属性的浏览器上,弹出的顺序则是:“script”、“
阅读全文