zoukankan      html  css  js  c++  java
  • 与流程相关的一些问题

    1、登录或注册时,防止重复提交

    1 if(username === oUser.attr("data-username-v"))   //避免重复校验,给自定义属性赋值后取出比对校验
    2  {
    3         return;
    4  }

     避免用户连续点击按钮,向后台请求数据,可以使用到 window[action] = bool值

     代码....

    2、IE或者其他支持标准的浏览器对input事件的支持

     1  //标准浏览器
     2  $("#" + _arr_ck[j]).on("input",function(evt){
     3             if(evt.currentTarget.value){
     4                //.....
     5             }else{
     6                 //.....
     7             }
     8  });
     9 
    10  //for ie username or password input
    11  if(document.all){
    12         $('input').each(function() {
    13             var that=this;
    14             if(this.attachEvent) {
    15                 this.attachEvent('onpropertychange',function(e) {
    16                     if(e.propertyName!='value') return;
    17                     $(that).trigger('input');
    18                 });
    19             }
    20         })
    21  }

    3、关于return的理解

        在方法A中调用B方法,B方法中的return只能让阻止B方法中其他代码的执行,而不影响A 方法的其他代码执行。

    4、jsonp不支持同步,需要后台配合校验

    5、自定义同步流程

  • 相关阅读:
    python file op
    python write read
    Linux MD RAID 10
    bitmap.h
    1
    write 1 to block device
    tr '00' '377' < /dev/zero | dd of=/dev/$i bs=1024 count=1024000
    Superblock
    echo -e "33[41;36m something here 33[0m"
    May It Be
  • 原文地址:https://www.cnblogs.com/yiliweichinasoft/p/3784710.html
Copyright © 2011-2022 走看看