zoukankan      html  css  js  c++  java
  • ajax json 模板

    ajax json 模板

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="jquery-1.4.4.min.js" language="javascript" type="text/javascript">
    </script>
    <script type="text/javascript">
    function load()
    {
    alert(
    "test");
    hotsearch(
    "http://api.t.sina.com.cn/users/show/wangkangluo1.json?source=3153373932");
    }

    function hotsearch(index)
    {
    if (window.XMLHttpRequest)
    {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    //sortname = encodeURI(sortname);
    }
    else
    {
    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    //sortname = encodeURI(sortname);
    }
    //q = encodeURI(type);
    gScriptObj = document.createElement("script");
    gScriptObj.setAttribute(
    "type", "text/javascript");
    gScriptObj.setAttribute(
    "charset", "utf-8");
    //if(index ==1)
    //{
    gScriptObj.setAttribute("src", index);
    headObj
    = document.getElementsByTagName("head").item(0);
    headObj.appendChild(gScriptObj);
    }

    function json_back(json)
    {
    alert(json);
    }


    </script>
    </head>

    <body onload="load()">
    <div class="me">test</div>
    </body>
    </html>

  • 相关阅读:
    Python爬虫之-动态网页数据抓取
    Python爬虫之 正则表达式和re模块
    Python爬虫 XPath语法和lxml模块
    Python 多线程爬虫
    PAT 1037 在霍格沃茨找零钱
    PAT 1033 旧键盘打字
    PAT 1019 数字黑洞
    PAT 1057 数零壹
    PAT 1026 程序运行时间
    PAT 1023 组个最小数
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2102985.html
Copyright © 2011-2022 走看看