document.elementFromPoint(x,y); not working
i am using
document.elementFromPoint(x,y);
function to find out the underlying element on the mouse click. It is working fine when i open the corresponding html file with firefox. But i have written an application using 开发者_如何学Pythongtkmozembed to open html files. When i open html file with my application and clicked on the page it is giving following error:
TypeError: document.elementFromPoint is not a function
Why it is so? Actually all the functions which works for firefox, also work with gtkmozembed right?(as both firefox and gtkmozembed uses gecko engine internally)
It is true both Firefox and gtkmozembed use Gecko rendering engine, but versions of engines you are trying your code in may be different, so that the function may be or may be not available.
Worth noticing, it is hardly necessary to use this function in reality - you can approach the problem from the other side - check the event.target property to see where your mouse event was originated.
BTW: document.elementFromPoint function is another example of great yet proprietary technology originated from Internet Explorer. As many other good features it was picked up only recently and implemented by many vendors including Mozilla.
精彩评论