我在function
Javascript
时遇到问题,按下onkeypress event
代码是:
function defaultButton(artist, album) {
alert("default Button");
var EKC = event.keyCode;
switch (EKC) {
case (29443): // Enter Key
var content1 = artist;
var content2 = album;
window.location = "app/html/player.html?rtmp="+content1+"&file="+content2;
break;
}
}
我的html
看起来像这样
<img src="image.jpg" data-artist="someArtistName" data-album="someAlbum" onkeydown="defaultButton(this.data-artist, this.data-album)" />"
但是当我触发onkeypress event
时,在控制台上打印的[JS ERROR]
是
[JS ERROR]:
File:
Line No: 0
Error Detail: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
我搜索谷歌的错误,并且主要说它不是一个主要问题,链接here我的搜索。需要一些帮助。