jquery - X-editable official example (jsFiddle) doesn't work -
i learning x-editable library , wonder why 1 of examples official website not working.
javascript
$('#username').editable({ type: 'text', url: '/post', pk: 1, title: 'enter username', ajaxoptions: { datatype: 'json' }, success: function(response, newvalue) { if(!response) { return "unknown error!"; } if(response.success === false) { return response.msg; } } }); //ajax emulation $.mockjax({ url: '/post', responsetime: 200, response: function(settings) { if(settings.data.value) { this.responsetext = '{"success": true}'; } else { this.responsetext = '{"success": false, "msg": "required"}'; } } });
see full code here: http://jsfiddle.net/xbb5x/62/
when click on editable text, change , click 'ok' button, nothing happens after it. thing can see loading icon. can explain what's wrong it? thank you!
(taken http://vitalets.github.io/x-editable/demo-bs3.html section "more examples , tricks (jsfiddle)" )
you should update jsfiddle external resource - jquery.mockjax.js
works fine this:
https://cdnjs.cloudflare.com/ajax/libs/jquery-mockjax/1.6.2/jquery.mockjax.js
Comments
Post a Comment