<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-01-20 14:38:37Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
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....
</div>
I am not familiar with PHP, but can you change you output type to make it text\json, and make sure that the ./viewForms doesn't include anyother php files that generates any HTML
Well, if your htm
variable has an extra close parenthesis at the end, literally like so:
{"attributes":[{"type":"Text","labels":"Untitled1"}]}) /* extra close paren */
then that's your problem. Getting rid of the close parenthesis at the end forms a valid JSON string:
{"attributes":[{"type":"Text","labels":"Untitled1"}]} /* no close paren */
Perhaps if you shed some more light on the ./viewForms
request handler (even give a code excerpt via pastebin) we could help more.