getJSON Synchronous
问题 GOAL: What I'm after is to get data from database and refresh main.php (more evident through draw_polygon) every time something is added in database (after $.ajax to submit_to_db.php). So basically I have a main.php that will ajax call another php to receive an array that will be saved to database, and a json call another php to return an array will be used by main.php. $(document).ready(function() { get_from_db(); $('#button_cancel').click(function(){ $.ajax({ url: 'submit_to_db.php', type: