• 去掉input阴影&隐藏滚动条&抛异常&预加载&curl传json


    1.隐藏滚动条:-webkit-scrollbar{ display:none; }

    2.array_walk():数组里的每个元素执行一个自定义函数;

    array_map():数组里的每个元素执行一个自定义函数,并返回一个新的函数;

    3.去掉input内的阴影:

    appearance:none;

    -webkit-appearance:none;

    3.curl发送json格式的数据:

    $data_string =  json_encode($arr);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data_string)
    ));

    4.tp框架里的抛异常处理:

    try {   
        throw new \Think\Exception("error");  
    } catch (\Think\Exception $e) {   
        echo $e->getMessage();   
    exit();   
    }   

    5.PHP版本高于5.5时,curl文件上传必须使用CurlFile对象

    $a = new \CURLFile($real_path);

    6.从网上down的代码一定要注意全角半角的问题,sublime没有提示,把前边的缩进全部删除自己打上空格;phpstorm有提示

    7.预加载图片:

      <script type="text/javascript">
        
          var images = new Array()
          function preload() {
            for (i = 0; i < preload.arguments.length; i++) {
              images[i] = new Image()
              images[i].src = preload.arguments[i]
            }
          }
          preload(
            "http://domain.tld/gallery/image-001.jpg",
            "http://domain.tld/gallery/image-002.jpg",
            "http://domain.tld/gallery/image-003.jpg"
          )
        
      </script>
  • 相关阅读:
    YOLO V5
    YOLO系列(单阶段目标检测)
    优化算法
    算法总结
    图像分类算法
    ResNet网络(里程碑)
    GoogleNet网络(纵横交错)
    VGGNet网络(走向深度)
    AlexNet网络(开山之作)
    案例
  • 原文地址:https://www.cnblogs.com/Basu/p/7902522.html
Copyright © 2020-2023  润新知