I wrote a script using jQuery and AJAX today, and I get some errors...
The script:
function changeAdmin(id) {
$(document).ready(function() {
$(\'#ta
If you have tried setting the header content type and are still getting the error. It is my expectation that the server is replying with a fault from your server side code. Usually when a debug message is given it is in pure HTML not JSON thus the unexpected token.
The quickest way to debug this is to set the DataType of the HTML instead of JSON so that you can see whatever output there is from the server, not just JSON formatted data.
Once you have seen the error that is being produced by your server side code and fixed it, you can then return to being a DataType of JSON.