測了幾款手機:
小米:: 自帶瀏覽器:支持
iphone4s:: safari:不支持 QQ瀏覽器:不支持 UC8.3.1:不支持
NOKIA5238::自帶瀏覽器:支持 UC8.3:不支持
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script defer language="javascript" type="text/javascript">
document.onclick = clickStat;
function clickStat() {
// 創建空html標簽
e=arguments[0]||window.event;
var image=document.createElement("img");
//image.alt="abc";
image.height=0;
image.width=0;
x=e.clientX;
y=e.clientY;
//記錄點擊坐標
image.src="http://localhost:8080/r?width=" + screen.width + "&x=" + x + "&y=" + y;
//向服務器發送數據
document.body.insertBefore(image);
return true;
}
</script>
</head>
<body>
測試abc
</body>
</html>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script defer language="javascript" type="text/javascript">
document.onclick = clickStat;
function clickStat() {
// 創建空html標簽
e=arguments[0]||window.event;
var image=document.createElement("img");
//image.alt="abc";
image.height=0;
image.width=0;
x=e.clientX;
y=e.clientY;
//記錄點擊坐標
image.src="http://localhost:8080/r?width=" + screen.width + "&x=" + x + "&y=" + y;
//向服務器發送數據
document.body.insertBefore(image);
return true;
}
</script>
</head>
<body>
測試abc
</body>
</html>