User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,479 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,922 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

returning array from ajax.responseText?

Join Date: Oct 2007
Posts: 34
Reputation: adrive is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
adrive adrive is offline Offline
Light Poster

Re: returning array from ajax.responseText?

  #3  
Nov 29th, 2007
do you mean the code that produces the output for javascript?

$user = null;

$userData = array();

try
{

if(isset($_SESSION['name'])){
$userData['name'] = $_SESSION['name'];
}
if(isset($_SESSION['userid'])){
$userData['userid'] = $_SESSION['userid'];
}

}
catch(Exception $e)
{
logger($e->getMessage());
echo "Error : " .$e->getMessage();
}

echo $userData;

not much use, it just produces 'Array' plain text. If that's the case, do you mean i'll actually have to organise my own data into an understandable structure, and then chop it out from javascript and pass back to an array manually?

such as from php,

echo $myArrayStr = "name='mr box' | age=20 | sanity = 'not really' ";

then in javascript,

maybe some sorta split function that separates the "|" delimeter and assign them all into javascript?
Last edited by adrive : Nov 29th, 2007 at 3:28 am.
Reply With Quote  
All times are GMT -4. The time now is 5:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC