js的几种交互模式

  1. WebSocket 

 https://www.ibm.com/developerworks/cn/web/1112_huangxa_websocket/

  1. Jsonp

(JSONwith Padding)是资料格式json的一种“使用模式”,可以让网页从别的网域获取资料

 

functionupdatePage(result, methodName)

{

varhtml = '

    ';

    ……

    document.getElementById('city').innerHTML= html;

    }

    functiongetInfo()

    {

    varurl = ".....";

    varscript = document.createElement('script');

      script.setAttribute('src',url);

      document.getElementById("loadjs").innerHTML= "";

      document.getElementById("loadjs").appendChild(script);

    }

    getInfo();

  1. AJAX

即“AsynchronousJavaScript and XML”(异步JavaScriptXML),是指一种创建交互式网页应用的网页开发技术。

           



你可能感兴趣的:(web)