无法调用正确的函数并打印错误event.layerX和event.layerY

时间:2013-10-11 12:40:53

标签: javascript jquery

我在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我的搜索。需要一些帮助。

0 个答案:

没有答案