zoukankan      html  css  js  c++  java
  • img的绝对路径转为相对路径

    $('#add_img').on('change', function(){

    var objUrl = getObjectURL(this.files[0]) ;
    if (objUrl) {
    $(this).prev("img").attr("src", objUrl);
    }

    });


    function getObjectURL(file) {
    var url = null;
    if (window.createObjectURL != undefined) { // basic
    url = window.createObjectURL(file);
    } else if (window.URL != undefined) { // mozilla(firefox)
    url = window.URL.createObjectURL(file);
    } else if (window.webkitURL != undefined) { // webkit or chrome
    url = window.webkitURL.createObjectURL(file);
    }
    return url;
    }

  • 相关阅读:
    whoami
    w
    id
    su
    chpasswd
    chage
    password
    scrapy框架中Download Middleware用法
    scrapy框架持久化存储
    scrapy框架中Item Pipeline用法
  • 原文地址:https://www.cnblogs.com/yanaweb/p/5856608.html
Copyright © 2011-2022 走看看