admin管理员组

文章数量:1291117

I have definitely used this code before, but this time around it throws an error.

My code:

$(document).click(function (e) {
  var getPoint = document.getElementFromPoint(e.pageX,e.pageY);
  alert(getPoint);
});

And I get the following Error:

document.getElementFromPoint is not a function

I have definitely used this code before, but this time around it throws an error.

My code:

$(document).click(function (e) {
  var getPoint = document.getElementFromPoint(e.pageX,e.pageY);
  alert(getPoint);
});

And I get the following Error:

document.getElementFromPoint is not a function
Share Improve this question edited Dec 13, 2013 at 8:47 Sachin Jain 21.8k34 gold badges110 silver badges176 bronze badges asked Nov 9, 2010 at 9:40 Barrie ReaderBarrie Reader 10.7k11 gold badges77 silver badges141 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

In Firefox this function is called document.elementFromPoint()

https://developer.mozilla/En/DOM:document.elementFromPoint

I have changed the method from : getElementFromPoint , to : elementFromPoint and it is working fine in IE8 & latest firefox.

本文标签: javascriptgetElementFromPoint(xy)whaaaatStack Overflow