本例子以vue语法伪代码书写: 1,获取服务端北京时间 getRealTime() { let that = this; var xhr = new XMLHttpRequest(); if( !xhr ){ xhr = new ActiveXObject("Microsoft.XMLHTTP"); } xhr.open("HEAD",location.href,true); xhr.onreadystatechange=function(){ if( xhr.re…
1.js获取对象的绝对坐标 方法1: function getAbsPoint(e) { var x = e.offsetLeft, y = e.offsetTop; while(e=e.offsetParent) { x += e.offsetLeft; y += e.offsetTop; } alert("x:"+x+","+"y:"+y); } 方法2: function getAbsPoint(obj) { var x,y; oRect…