Getting database values in Javascript variable dynamically

前端 未结 3 1204
长情又很酷
长情又很酷 2021-01-27 06:03

I researched this subject many times but I could not find the right answer to my question. Let me explain it.

I\'m creating an app with the Google Maps API where I want

3条回答
  •  旧时难觅i
    2021-01-27 06:52

    The examples on http://us1.php.net/json_encode should be helpful. It looks like your $post should be an associative array:

    $post[] = ("name"=>"test","lat"=>52.351753, "lon"=> 5.002035); ?>
    var bedrijven = ;
    

    outputs:

    var bedrijven = [{"name":"test","lat":52.351753,"lon":5.002035}];

提交回复
热议问题