gpt4 book ai didi

javascript - Uncaught ReferenceError : WebKitPoint is not defined

转载 作者:搜寻专家 更新时间:2023-11-01 04:45:54 26 4
gpt4 key购买 nike

我使用 Sencha Touch 1.1.1

昨天 Google Chrome 更新到 39 就开始报这个错

Uncaught ReferenceError: WebKitPoint is not defined

因为他们已经删除了 WebKitPoint。 Sencha Touch 有一个带有 WebKitPoint 的代码,位于此处 http://cdn.sencha.io/touch/sencha-touch-1.1.1/sencha-touch.js在第 6 行。是的。

getXY: function() {
var a = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
return [a.x, a.y]
}

我认为 WebKitPoint 是某种函数对象 {x:0, y:0} 但我无法制作/创建 JavaScript 代码想要的东西;我写了这个 WebKitPoint = {x:0, y:0} 但它再次给出错误,这次说它不是一个函数。

我还发现了这个:https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/pIbpN_8Lqpg

tl;博士Google Chrome 39 不再支持 WebKitPoin。如何模拟或替换它?

最佳答案

你可以尝试更换

var point = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
return [point.x, point.y]

var rect = this.dom.getBoundingClientRect();
return [rect.left, rect.top];

来源:https://code.google.com/p/chromium/issues/detail?id=434976#c10

代码来源:Philip Jägenstedt

关于javascript - Uncaught ReferenceError : WebKitPoint is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27040297/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com