UPDATE: Since the click event was wired up with an element in the kendo UI Grid control, the event was undefined. My colleague suggested to use window.event.clientX and it worked. Thanks.
I am trying to access the pageX, pageY fields inside a javascript function but it does throws up an exception as pageX being not a property of event. I am also new to client side coding. Any help would be appreciated.
Below is the code.
function showDetails(e) {
$.ajax(
{
url: '/List/Reader',
type: 'json'
}).success(function (data, status, xhr)
{
readers = data;
$("#cardholderdetails").html("");
var length = data.length;
for( var i = length-1;i>length-3; i--)
$("#cardholderdetails").append("<img src = " + readers[i].FileName + " width='60' height='60' id='cardholderpic'/><span>" + readers[i].Name1 + "</span><br/>");
$("#cardholderdetails").css('top', e.pageY+20).css('left', e.pageX+10);
$("#hider").append("<a id='buttonClose' href=javascript:close()>Close</a>");
$("#hider").fadeIn("slow");
$('#cardholderdetails').fadeIn("slow");
}).error(function (status, error) {
alert("Failed to retrieve alarms");
});
}
What am i missing.