thesnarkie Posted April 20, 2010 Report Share Posted April 20, 2010 (edited) 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 April 20, 2010 by thesnarkie Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted April 20, 2010 Report Share Posted April 20, 2010 Nelieto serialize, bet json_encode, to JS saprot. Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted April 20, 2010 Author Report Share Posted April 20, 2010 Paldies! (: Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted April 21, 2010 Author Report Share Posted April 21, 2010 (edited) 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 April 21, 2010 by thesnarkie Quote Link to comment Share on other sites More sharing options...
marcis Posted April 21, 2010 Report Share Posted April 21, 2010 http://api.jquery.com/jQuery.getJSON/ Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted April 21, 2010 Author Report Share Posted April 21, 2010 Ohh, pilnīgi izkrita no galvas, ka bija getJSON. Paldies! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.