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,930 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,272 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: Jul 2006
Location: Deptford, London
Posts: 916
Reputation: MattEvans will become famous soon enough MattEvans will become famous soon enough 
Rep Power: 5
Solved Threads: 46
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: returning array from ajax.responseText?

  #2  
Nov 29th, 2007
Eek.. again you need a way of determining IN JAVASCRIPT what the contents of a response represent. Semantically, there is no difference between an echoed PHP array and a line of plain text. All you are doing at the moment is reading the response text ( a string ) and trying to implicity cast it to a javascript array - this won't work.

When PHP echoes an array, it just prints out text to be output at the browser; at the javascript end you'd need to interpret that array using text manipulation functions or some other processing method, in order for that plain text to be a meaningful javascript array.

Just remember, the output from a typical server-side application doesn't have the same meaning as the running code that generated it; it has whatever meaning you choose to give it, but you have to choose how to deal with it, in order to give it any meaning atall.

That aside.. can you post the output from your PHP page? I'm not in the mood to run PHP code this morning, but I want to see how close to interpretable an array dump is..
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 6:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC