I tried to get as much info into the title as posible... hope it doesnt confuse anyone
i have an initAll() called on window.onload
within initAll() I assign a few onclick handlers to some links. However, it would be great if I could pass an argument to the handler, so I could use the same handler every time... but if I include two brackets for each handler, it executes immediately... ignoring the 'onclick' bit...
window.onload = initAll;
function initAll(){
document.getElementById('btn_events').onclick = getSpecificFeed('events');
}
function getSpecificFeed(type) {
var url = make_abs('home','specific','feed=' + type); //special fn to create an absolute url for my ajaxCall fn to use
var query_string = ''; //post vars for my ajax fn - not used this time
ajaxCall(url,query_string,refreshFeed); //special ajaxcall fn which returns output to the refreshFeed fn below
}
//this fn catches http.responseText from ajaxCall
function refreshFeed(reply){
document.getElementById('feed_items').innerHTML = reply;
}