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
Post a Comment