版权声明:好歹是我写的或者总结的或者抄的,总待给我个名份吧~ https://blog.csdn.net/sangjinchao/article/details/52250318

html代码

<img id="newImage" alt="100x100" src="__PUBLIC__/img/1.jpg" class="img-circle" width="100px" height="100px" >

<input id="image" type='file' name='myFile' size='15' onchange="showPicture(this)"/>

js代码

function showPicture(imgFile){

// alert(window.URL.createObjectURL(imgFile.files[0]));

/*获取上传文件的路径*/

document.getElementById("newImage").src = window.URL.createObjectURL(imgFile.files[0]);

}

js获取input file路径改变图像地址的更多相关文章

  1. js 获取input file路径改变图像地址

    html代码 <img id="newImage" alt="100x100" src="__PUBLIC__/img/1.jpg" ...

  2. js获取input file完整路径的方法

    function getPath(){  //判断浏览器  var Sys = {};  var obj = document.getElementById("headImg"); ...

  3. js获取 input file 图片缩略图

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. js 获取 input file 文件 附给 image src

    var a=document.querySelector('input[type=file]'); a.onchange = function (e) { //var reader = new Fil ...

  5. js获取input file文件二进制码

    <html> <body> <img id="image"src=""/> <br/> <input ty ...

  6. js 获取input type="file" 选择的文件大小、文件名称、上次修改时间、类型等信息

    文件名的传递 ---全路径获取 $('#file').change(function(){ $('#em').text($('#file').val()); }); 文件名的传递 ---只获取文件名 ...

  7. js清空input file的值

    原文:js清空input file的值 在做选择本地图片上传的功能时遇到一个问题,第一次点file按钮选择图片完成会触发onchange事件,获取文件后动态在界面上创建img标签展示,但把创建的img ...

  8. js获取项目根路径

    //js获取项目根路径,如: http://localhost:8083/uimcardprj function getRootPath(){ //获取当前网址,如: http://localhost ...

  9. java 或者 js 获取项目访问路径(域名)

    /** * 获得站点url * @return */ public String getWebUrl(){ String url = getRequest().getScheme() + " ...

随机推荐

  1. Bootstrap时间控件常用配置项

    1.给下面4个文本框初始化   $(function(){ $("#orderStartTime,#orderEndTime,#preSaleStartTime,#preSaleEndTim ...

  2. 给已有数据的oracle表建立外键关系

    PS:这里是给自己做个备忘,下次遇到同类问题的时候,方便查找: 客户在有主外键关系的2张表进行页面删除时报错已有子记录,运维后台处理的时候应该找出相应的数据,先删除子记录,在删主表记录:但客户要的急, ...

  3. Mongodb总结3-稍微封装一下

    上次发表的2,纯粹是Demo,演示API的用法. 今天,稍微封装了下,看得更清楚. 考虑到不容易做得很有通用性,所以封装的一般,换种场景需要直接修改代码,但是有一部分是可以复用的. 最近项目,很可能只 ...

  4. [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''&lt;h1 style=&quot;text-align: center;&quot;&gt;php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  5. WIN7/8/10下批处理提权工具

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 自动添加批处 ...

  6. javascript中的this指向问题总结

    this的指向在函数定义的时候是确定不了的,只有函数执行的时候才能确定this到底指向谁,实际上this的最终指向的是那个调用它的对象 1.函数执行的时候,首先看函数名前边是否有点 ‘·’,有的话点’ ...

  7. 洛谷——P1089 津津的储蓄计划

    https://www.luogu.org/problem/show?pid=1089 https://www.luogu.org/problem/show?pid=1089 题目描述 津津的零花钱一 ...

  8. OVS中对于用户层和datapath层的多个通道利用epoll进行控制

    这里先临时记录下代码流程,有待完好. static int construct(struct ofproto *ofproto_) { struct ofproto_dpif *ofproto = o ...

  9. php杂项函数

    php杂项函数 一.总结 看着函说作用 函数 描述 PHP     constant() 返回一个常量的值. 4 define() 定义一个常量. 3 defined() 检查某常量是否存在. 3 d ...

  10. storm集群操作指南

    目录 storm集群操作指南 一.storm伪分布式安装 (一)环境准备 (二)安装zookeeper (三)安装storm (四)运行程序 二.storm集群安装 (一)下载storm并解压 (二) ...