i strange error in ie.. no problems in both ff , chrome
when alert variable this:
json_post('delete_accounting', 'json.action.php?action=delete_accounting', 'id=682', 'rtn_accounting', {tr_id:'tr_acc682', enc_id:374, delete:1});
but when want eval() sting error (the error translated danish, don't know how put in english?)
id, string or integer expected
edit:
var xmlhttp = {}; function json_post(request_var, response, get_str, callback_function, callback_var) { request_var += math.floor(math.random()*999).tostring(); cnstr.mouseloader.cnstr(); if(window.xmlhttprequest) xmlhttp[request_var] = new xmlhttprequest(); else if(window.activexobject) xmlhttp[request_var] = new activexobject('microsoft.xmlhttp'); xmlhttp[request_var].open('post', response, true); xmlhttp[request_var].setrequestheader('content-type', 'application/x-www-form-urlencoded'); xmlhttp[request_var].onreadystatechange = function() { if(xmlhttp[request_var].readystate == 4) { cnstr.mouseloader.dstr(); if(callback_function) eval(callback_function+'('+xmlhttp[request_var].responsetext+(callback_var ? ', callback_var':'')+')'); } } xmlhttp[request_var].send(get_str); }
i'm quite sure error occurs in eval() because when run sting real code there no problems..
like this:
json_post('delete_accounting', 'json.action.php?action=delete_accounting', 'id=682', 'rtn_accounting', {tr_id:'tr_acc682', enc_id:374, delete:1});
i have tried escape in callback function rtn_accounting(), , still same error in same line eval()
by adding quotes in object in last parameter works
json_post('delete_accounting', 'json.action.php?action=delete_accounting', 'id=682', 'rtn_accounting', {'tr_id':'tr_acc682', 'enc_id':374, 'delete':1});
Comments
Post a Comment