I use JQuery's $. Ajax () was never able to return json format that can be recognized, if I dataType = 'json' cancel, you can return the correct string. If the background using the JAVA language, how to output the correct json format for ajax can be identified?

I suggest you using jQuery 1.4, if so you should generate correct json format. Malformed JSON (for instance {foo: "bar"}) will be rejected by jQuery 1.4.
To solve the above example problem change {foo:"bar"} to {"foo":"bar"}.