use js for $.ajax instead of json string