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>

  • 相关阅读:
    css 伪类
    tornado 作业 简单首页 登录页 个人中心
    tornado 作业 自定义模板 UIMethod以UIModule
    tornado 网页提交内容 展示内容作业
    tornado
    javascript
    廖雪峰官网学习js 数组
    廖雪峰官网学习js 字符串
    廖雪峰官网学习js 数据类型和变量
    协程gevent学习
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2102985.html
Copyright © 2011-2022 走看看