zoukankan      html  css  js  c++  java
  • mooltools扩展之前已经定义好的方法和json数据

    在原先的json数据中再新增数据

    Object.append(ajaxData,{arrAttach : xxx ... // 新的数据});

    扩展原先已经定义好的方法

    callFun.extend("bind",function(){...// 新的操作}) 

    这样可以用于多个并列操作,但又存在微小差异的ajax请求的发送

            var ajaxData = {
                    "type" : $sendObjDeal()
                },callFun = function(json){
                    msgArea.appendHTML(json.html,"top");
                    send.fireEvent("afterCheckSubmit", send);
                    clearMsgInput();
                },ajaxUrl;

            if (flag === "0"){
                ajaxUrl = ...;
                Object.append(ajaxData,{content : eassyCont.val()});
                callFun.extend("bind",function(){bindAfterSend(msgArea.getElement(".jsForIbtn"),1)})        
            }else if (flag === "1") {
                ajaxUrl = ContentItem.poll;
                Object.append(ajaxData,{pollItemContentTexts:JSON.encode($$(".jsForPollOption").val()), 

                                        pollContentText : voteQuestion.val()

                                       });
                callFun.extend("bind",function(){bindAfterSend(msgArea.getElement(".jsForIbtn"),4)})
            } else if (flag === "2") {
                ajaxUrl = ContentItem.assignment;
                ...// 独立的操作
               
            }
            // 统一发送ajax请求
            new AjaxPost(this,{
                url : ajaxUrl,
                data: ajaxData,
                callback : function(json){
                    callFun(json);
                    callFun.bind()
                }
            }).send()

  • 相关阅读:
    6.3 The Memory Hierarchy
    去掉正在打印对话框
    SQL SERVER格式化字符串位数,不足补零
    WCF学习系列二_使用IIS发布WCF服务
    WCF学习系列一_创建第一个WCF服务
    IrisSkin4控件使用方法
    窗体加载后的设置焦点事件
    SQL 分组后取最小行号记录
    二维数组、齿形数组和游长变元表
    C#数组按值和按引用传递数组区别
  • 原文地址:https://www.cnblogs.com/timelyxyz/p/2534635.html
Copyright © 2011-2022 走看看