In my app i m using JQuery..In tat I m using tat Ajax GEt to retrive values from cakephp controller viewforms ….But if i alert myObject..It doesnt came..
It show me the error as
missing ) in parenthetical {"attributes":[{"type":"Text","labels":"Untitled1"}]})
where {"attributes":[{"type":"Text","labels":"Untitled1"}]}) is my htm
This is my JQuery code
$.ajax({
type: "POST",
url: "./updateField",
data: "name=" + fieldname,
success: function(msg){
}//success
});//ajax
//Retriving the updated value in JSON Format
var htm = $.ajax({
type: "GET",
url: "./viewforms",
async: false
}).responseText;
var myObject = eval('(' + htm + ')');
But the same code works well in other system. Please suggest me….
Well, if your
htmvariable has an extra close parenthesis at the end, literally like so:then that’s your problem. Getting rid of the close parenthesis at the end forms a valid JSON string:
Perhaps if you shed some more light on the
./viewFormsrequest handler (even give a code excerpt via pastebin) we could help more.