I downloaded the rather new Ext Core 3.0, both the development and the production packages. It was very easy to "install" and start using it. However when I tried to do some simple ajax (getting data asynchronously from another page in this case) I got an error message.
This code is used to send form data to a back-end page.
<script src="js/ext-core-debug.js"></script> <script type="text/javascript"> function controller_call() { Ext.Ajax.request({ url: 'controller/test.php', form: 'myForm', success: function(response, opts) { var obj = Ext.decode(response.responseText); console.dir(obj); console.log(response.responseText); }, failure: function(response, opts) { console.log('server-side failure with status code ' + response.status); } }); } </script> |
When doing this the error message
'Ext.decode is not a function' is displayed.
Apparently this decode function (or actually the JSON functionality in general) is not by default included when including the javascript toolkit as desribed to do.
The way to fix this is to separately include the JSON package. Add this row to the above and it will work.
| <script src="js/build/util/JSON-min.js"></script> |
This is said to be addressed in the next release.