I have a simple jquery / ajax request to a server that returns the structure and data of an array. I was wondering if I could use this array structure and data using jquery;
Simple request;
var token = $("#token").val(); $.ajax({ type: 'POST', url: './', data: 'token=' + token + '&re=8', cache: false, timeout: 5000, success: function(html){
result (actual result from PHP print_r (););
Array ( [0] => Array ( [username] => Emmalene [contents] => <ul><li class="name">ACTwebDesigns</li><li class="speech">helllllllo</li></ul> <ul><li class="name">ACTwebDesigns</li><li class="speech">sds</li></ul> <ul><li class="name">ACTwebDesigns</li><li class="speech">Sponge</li><li class="speech">dick</li></ul> <ul><li class="name">ACTwebDesigns</li><li class="speech">arghh</li></ul> ) )
I thought line by line
var demo = Array(html);
Not sure if this will work, it just popped into my mind.
Any help is greatly appreciated.
jquery arrays php
Phil jackson
source share