Love PHP, but very new to JavaScript. I'm following a tutorial, and one thing has me stuck. I call the markRead function with:
<a href="#" onclick="return false;" onmousedown="markRead(9,notifreq_9)">
function markRead(noteid,elem){
var action = "delete";
var ajax = ajaxObj("POST", "php_parsers/notification_parser.php");
ajax.onreadystatechange = function() {
if(ajaxReturn(ajax) == true) {
if(ajax.responseText == "deleted"){
_(elem).innerHTML = "";
}
}
}
ajax.send("action="+action+"¬eid="+noteid);
}
For some reason it is reading noteid as a variable (i can alert(noteid) and it will report 9), but if I try alert(elem) it kicks back [object].
I cheated by assigning elem = notifreq_+noteid, but I would love to understand what is going on here... Can someone point me in the right direction to understand what is happening?
notifreq_9? That is probably an object, where as 9 is just an integer.