JSON常用写法

get写法

function f1(){
            //ajax去服务器端请求json信息回来
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function(){
                if(xhr.readyState==4){
                    alert(xhr.responseText)
                }
            }
            xhr.open('get','./04.php');
            xhr.send(null);
        }

猜你喜欢

转载自blog.csdn.net/qq_37171379/article/details/86475932