随笔分类 - JavaScript
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,
阅读全文
摘要:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,
阅读全文
摘要:1、右键点击 document.oncontextmenu = function(){ return false; } 2、a链接默认行为 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv=
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:click 鼠标点击事件 dblclick 鼠标双击事件 mousedown 鼠标按下 mouseup 鼠标抬起 mouseover 鼠标移入 mouseout 鼠标移出 mouseenter 鼠标移入 mouseleave 鼠标移出 mousemove 鼠标移动 mouseover 和 mouse
阅读全文
摘要:console.log(window.location.protocol); // 获取协议 console.log(window.location.host); // 获取主机名和端口号 console.log(window.location.hostname); // 获取主机名 console
阅读全文
摘要:JavaScript中获取元素document.getElementsByClassName()在IE8以下不兼容 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compat
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:/** * 获取当前时间 */ function getDate() { var date = new Date(); var year = date.getFullYear(); // 年 var month = formatTime(date.getMonth() + 1); // 月 var
阅读全文
摘要:在IOS整合H5页面的时候,自定义的按钮失去效果,Android系统可以。 如图,确定和取消按钮在IOS系统无效。 解决办法是在两个按钮上加上一个style属性即可 <span class="upper-sp sureExit" style="cursor:pointer">确定</span> <s
阅读全文