I came across some code on an MDN article, and I'm not really sure how to make sense of what it does.
document.onmousemove = function(e) {
curX = (window.Event) ? e.pageX : e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
curY = (window.Event) ? e.pageY : e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
}
I'm familiar with ternary operators, but I've never seen multiple "?" used in one line. Can someone explain to me how to evaluate the code for curX and curY? I would appreciate a simple explanation as I'm fairly new, but be as detailed as you want. Thanks