SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2008
    0 Post(s)
    0 Thread(s)

    quickest way to send data to javascript?

    I'm creating a php website which uses javascript (jquery) to draw a google map and place up to about 500 markers.

    Currently, php creates an xml file for javascript to read and place markers accordingly (loosely based on this tutorial -

    I have < 2meg connection, but it is quick enough on latest browsers. IE 8 is REALLY slow to both draw initial map and sometimes gives up before placing markers.

    Tried ditching the xml idea and using httpRequest instead, to get the info real-time from php. It works, but the markers appear really slowly.

    Just wondering if there is a quicker way to pass the information to javascript?

    Each marker needs id, longitude, latitude and title.

    php currently uses a session to store an array of place ids (the result of a search) and then looks up other info in mysql.

    Would appreciate any advice on the best way of getting my marker info into javascript.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Christchurch, New Zealand
    104 Post(s)
    4 Thread(s)
    Quote Originally Posted by treacle0996 View Post
    Would appreciate any advice on the best way of getting my marker info into javascript.
    How about having a php file that responds with javascript code, and having the HTML page request the javascript code from that location?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts