Jump to content
php.lv forumi

php serialize -> js


thesnarkie

Recommended Posts

Piemēram, man ir šāds te pēc php f-jas serialize() : a:2:{s:6:"status";b:1;s:5:"error";a:2:{s:4:"code";i:0;s:7:"message";s:0:"";}}, kuru saņem javascript. Ir kaut kā iespējams to pārvērst iekš javascript listā?

Es varu arī serialize neizmantot, galvenais, lai varu php listu izmantot javascriptā kā listu.

Edited by thesnarkie
Link to comment
Share on other sites

Pag un kā iekš javascript to decodēt?

 

$.get("/rq/?action=deletePicture&pictureId=" + vCurrentPhoto, function( txt ){
var vResponse = json_decode(txt);
$("#pictureResponse" + vType).html(vResponse);
})

 

Firebug rādīja erroru: json_decode is not defined

Edited by thesnarkie
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...