zoukankan      html  css  js  c++  java
  • AJAX

    AJAX = Asynchronous JavaScript and XML(异步的 JavaScript 和 XML)。

    AJAX 不是新的编程语言,而是一种使用现有标准的新方法。

    AJAX 最大的优点是在不重新加载整个页面的情况下,可以与服务器交换数据并更新部分网页内容。传统的网页(不使用 AJAX)如果需要更新内容,必需重载整个网页面。

    <script type="text/javascript" language="JavaScript">
        function ajaxProcess(type) {
            var extparam="0";
            if(type=="S2" || type=="S1"){
                extparam=$("#txtS2Shard").val();
            }
            if(type=="M1"){
                extparam=$("#txtM1Shard").val();
            }
            if(extparam=="")extparam="0";
            $.ajax({
                url: "ajaxRequest",
                type: "POST",
                async: false,
                data: {"requsettype": type,"extparam":extparam},
                success: function (msg) {
                    alert(msg)
                },
                error: function (ex) {
                    alert(ex.responseText);
                }
            });
        }
    </script>

    controller:

    @RequestMapping(value = "ajaxRequest", method = RequestMethod.POST, produces = "text/plain;charset=UTF-8")
        @ResponseBody
        public String ajaxDatas(@RequestParam String requsettype, @RequestParam String extparam) {
  • 相关阅读:
    文本属性和属性连写
    并集选择器
    子代选择器
    后代选择器
    交集选择器
    xpath helper 表格爬取
    爬取xiachufang图片试手
    bs4 beautifullsoup网页内容选择器
    requests第三方库使用 抓取
    python 爬虫学习
  • 原文地址:https://www.cnblogs.com/twoheads/p/10275726.html
Copyright © 2011-2022 走看看