Advertisement

07.14.2008 at 10:17AM PDT, ID: 23563375 | Points: 500
[x]
Attachment Details

data generated from php, on the google map and on the list

Asked by ioustinos_sarris in PHP and Databases, JavaScript, Asynchronous Javascript and XML (AJAX)

Hi there,
When i call the page myplaces.php the php script makes a query on the database and gets an array of my places. My places contain, id,name,X,Y.

What i want now is to show this data both on the map and on a list on the side of the map. This leaves me with the question "What is the best way to achieve that??"
The options i have come up with so far are:

A.  Myplaces.php generates the html for the list on the side of the map. The associative array with the data gets encoded on a json string, which is passed via onload function to javascript, and javascript takes care of showing these places on the map. I have a little problem doing that when using jquery though cause i cant pass this string at $(document).ready() function...Or can I??

B. Myplaces.php generates just two empty divs, one for the map and one for the list. Then at onload function i make an ajax call and the response is an hml string to be put in the list div and an json string to be manipulated for the map. I could use only the json string to create the html by using javascript and DOM for the list div if i wanted...

C. Myplaces.php generates the html for the list on the side of the map. In addition myplaces.php generates the javascript code, instantiating an array of objects (as if someone hard coded it), each representing one point.

Any ideas would be appreciated!
ThanksStart Free Trial
 
Loading Advertisement...
 
[+][-]07.15.2008 at 09:37AM PDT, ID: 22008539

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 04:18PM PDT, ID: 22011991

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 05:43PM PDT, ID: 22012407

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628