javascript - "undefined is not a function" onSuccessHandler -
i have problem in datasource file, on line onsuccesshandler( xmlrequest.responsetext ); here code
function initializehttprequest ( feedurl, onsuccesshandler, onerrorhandler ) { var onloadhandler = function( ) { if ( xmlrequest.readystate==4 && xmlrequest.status == 200 ) { onsuccesshandler( xmlrequest.responsetext ); } }; i use initializehttprequest in following way:
initializehttprequest(httpfeed, onsuccess(), onfailure()); // function onsuccess() { alert('true');} // function onfailure() { alert('true');} any json service call causing error "undefined not function" needed, spney sometime on it, , not familiar too.. thanks
remove parentheses. you're calling functions instead of calling initializehttprequest reference them:
initializehttprequest(httpfeed, onsuccess, onfailure); // ^^ ^^ since both onsuccess , onfailure don't return values, return value undefined , error message.
Comments
Post a Comment