设置PHP中的javascaript变量(PHP在javascript中)

set javascaript variable in the php (php is in javascript)

本文关键字:PHP javascript 变量 中的 javascaript 设置      更新时间:2023-09-26

我用JavaScript写php代码

这种类型

: -

function load(){
                var lan= "22.3000";
                var lng= "70.7833";
                var radius = "7000";
                var xml;
                var data = lan+","+lng+","+radius;
        xml = '<?php          echo file_get_contents("http://services.gisgraphy.com/geoloc/search?lat=23.00&lng=72.00&radius10000");?>'
                xmlDoc = $.parseXML( xml );
        $xml = $( xmlDoc );
           abc= xmlDoc.getElementsByTagName("asciiName")[0].firstChild.nodeValue;
        alert(abc);
            }


当页面加载

时,我想在php JavaScript中设置变量值lan lng和半径

你要做的是加载你的页面,然后做一个ajax调用加载页面与latlngradius参数