Passing values from JavaScript to PHP using AJAX

前端 未结 4 1398
小鲜肉
小鲜肉 2020-12-22 07:12

I don\'t know why my code is not working, I am trying to send the coordinates from JavaScript to PHP using AJAX and I am able to pull values from JavaScript to textbox but v

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 07:37

    The root cause is getLocation function will be a big delay, so you need to fire ajax call after getLocation is done. Please see the blow revised version:

    
    
    
    
    
    
    
     
    
    
    
     
    

    The only change is doing ajax call in the function showPosition.

提交回复
热议问题