jquery - Using a $.get value as a JSON object returns HierarchyRequestError: DOM Exception 3 -
i attempting grab json encoded value
{"3":"su","4":"demo","5":"data provider"}
via groups = $.get('actions/respond_groups.php');
however, when attempting use groups objects, so:
function resetedit(){ groups = $.get('actions/respond_groups.php'); $('.edit-group').editable('actions/manage_users.php?method=edit-group', { data : groups, type : 'select', submit : 'ok' }); }
however run into:
uncaught error: hierarchyrequesterror: dom exception 3 jquery.min.js:2 (anonymous function) jquery.min.js:2 p.fn.extend.dommanip jquery.min.js:2 (anonymous function) jquery.min.js:2 p.extend.each jquery.min.js:2 p.fn.p.each jquery.min.js:2 p.fn.extend.dommanip jquery.min.js:2 p.fn.extend.append jquery.min.js:2 $.editable.types.select.content jquery.jeditable.js:506 (anonymous function) jquery.jeditable.js:239 p.event.dispatch jquery.min.js:2 g.handle.h
looking thru google, seems people trying use return var;
i'm trying use object...
any ideas?
utilize callback function of $.get() request pass groups .editable() once request has resolved.
function resetedit(){ $.get('actions/respond_groups.php', function(groups){ $('.edit-group').editable('actions/manage_users.php?method=edit-group', { data : groups, type : 'select', submit : 'ok' }); }); }
Comments
Post a Comment