当前位置:网站首页>Input displays the currently selected picture
Input displays the currently selected picture
2022-07-04 05:37:00 【A bowl of noodles from the landlady】
1.jsp Code
<div class="lf salebd">
<a href="#">
<img src="images/ad20.jpg" id="img" width="100" height="100"/></a></div>2.js Code
$(function () {
$("#file").change(function () {
if (this.files.length) {
let file = this.files[0];
let reader = new FileReader();
// newly build FileReader object
reader.onload = function () {
// When FileReader When reading a file , The read results will be placed in FileReader.result Properties of the
document.querySelector('#img').src = this.result;
document.querySelector('#text').innerHTML = this.result;
};
// Set how to read files , Here we use base64 The way
reader.readAsDataURL(file);
}
})
})3. effect

边栏推荐
- 小程序毕业设计---美食、菜谱小程序
- Integer type of C language
- Talk about the SQL server version of DTM sub transaction barrier function
- Topological sorting and graphical display of critical path
- [matlab] general function of communication signal modulation - generation of narrow-band Gaussian white noise
- Descriptive analysis of data distribution characteristics (data exploration)
- C language simple student management system (including source code)
- Character types of C language
- ANSYS command
- LM小型可编程控制器软件(基于CoDeSys)笔记二十二:错误4268/4052
猜你喜欢

Character types of C language

Analysis of classical pointer and array written test questions in C language

19. Framebuffer application programming

【兴趣阅读】Adversarial Filtering Modeling on Long-term User Behavior Sequences for Click-Through Rate Pre

transformer坑了多少算力

2022年R2移动式压力容器充装复训题库及答案

Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
![[技术发展-25]:广播电视网、互联网、电信网、电网四网融合技术](/img/87/e0469e280365ed0261e2b551ebd888.png)
[技术发展-25]:广播电视网、互联网、电信网、电网四网融合技术

Graduation design of small programs -- small programs of food and recipes

BUU-Crypto-Cipher
随机推荐
Wechat applet +php realizes authorized login
Enterprise level log analysis system elk (if things backfire, there must be other arrangements)
[matlab] general function of communication signal modulation - generation of narrow-band Gaussian white noise
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
云原生架构实战案例及优化解决方案
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
2022年R2移动式压力容器充装复训题库及答案
Flutter ‘/usr/lib/libswiftCore. dylib‘ (no such file)
[matlab] matlab simulates digital baseband transmission system eye diagram of bipolar baseband signal (cosine roll off forming pulse)
Programming example of stm32f1 and stm32subeide -74hc595 drives 4-bit 7-segment nixie tube
Flask
Supplement the JS of a video website to decrypt the video
[interested reading] advantageous filtering modeling on long term user behavior sequences for click through rate pre
c语言经典指针和数组笔试题解析
Integer type of C language
SQL performance optimization skills
BUU-Crypto-[HDCTF2019]basic rsa
Leetcode 184 Employees with the highest wages in the Department (July 3, 2022)
Unity is connected to the weather system
Simulink and Arduino serial port communication