zoukankan      html  css  js  c++  java
  • form表单填充笔记

    $.fn.loadJson = function(jsonValue) {
      var obj = this;
      $.each(jsonValue, function(name, ival) {
        var $oinput = obj.find("input[name=" + name + "]");
        if ($oinput.attr("type") == "radio" || $oinput.attr("type") == "checkbox") {
          $oinput.each(function() {
            if (Object.prototype.toString.apply(ival) == '[object Array]') {
            //是复选框,并且是数组
              for (var i = 0; i < ival.length; i++) {
                if ($(this).val() == ival[i] || $(this).val() == '' + ival[i])
                  $(this).attr("checked", "checked");
              }
            } else {
              if ($(this).val() == ival || $(this).val() == '' + ival)
                $(this).attr("checked", "checked");
            }
          });
        } else if ($oinput.attr("type") == "textarea") {
          //多行文本框
          obj.find("[name=" + name + "]").html(ival);
        } else if ($oinput.attr("type") == "file") {

        } else {
          obj.find("[name=" + name + "]").val('' + ival);
       }
      });
    };

  • 相关阅读:
    adb入门学习笔记
    adb连接手机模拟器
    burp抓取手机模拟器流量
    Windows 下安装drozer(Windows 10),连接手机(红米note4X)
    UnicodeEncodeError: 'ascii' codec can't encode characters in position
    Windows下的Nessus安装与启动
    对VAuditDemo的一次审计
    http协议
    namp详解
    sqlmap详解
  • 原文地址:https://www.cnblogs.com/adolfvicto/p/8534421.html
Copyright © 2011-2022 走看看