So I'm new to javascript/ajax to certain level, to my understanding that calling function at least the proper way to call a function is by also using the parenthesis but take the code snippet for example on the onreadystatechange event, that line is calling a function which brings me to my point when I add the parenthesis my ajax calls fail but when i remove it it works seemlessly, that is not the issue my question is why doesn't work with the parenthesis if functions are called with it?
if(xhr){
xhr.onreadystatechange = showContent;
xhr.open("GET", url_new_posts, true);
xhr.send(null);
}else{
alert("Could not create XMLHttpRequest");
}