jquery - Cant pass php variable into ajax function -


i'm trying pass php variable ajax function (as below) dynamically change url used post request cant seem work, know i'm doing wrong?

<?php $site_url = "http://www.example.com/"; ?>  <script>     function refresh_div() {         jquery.ajax({             url: '<?php echo $site_url ?>';             datatype: 'json',             type:'post',             success:function(data) {                 jquery("#data").html(data.today_data);             }         });     } </script> 


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -