当前位置:首页>开发>正文

ajax怎样调用接口

2023-06-29 07:29:45 互联网 未知 开发

 ajax怎样调用接口

ajax怎样调用接口




"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/htmlcharset=UTF-8">
    <title>Weibotitle>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">script>
 <script type="text/javascript">
    $.ajax({

        url: "https://api.weibo.com/2/users/show.json",
        type: "GET",                                          
        dataType: "jsonp",
        data: {
            source:"appkey",
            uid: "自己微博的uid",
   count:"15"
        },
        success: function(data) {

   alert(data.data.screen_name)
   alert(data.data.location)
        }
    })
 script>
head>
<body>
    <div id="jsWeibo">div>
body>
html>

最新文章