springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 14:01:26
78
我在JavaScript中工作,基本上我想显示图像,当用户从设备中选择图像时,图像必须更改我在JavaScript文件中使用的代码。
<代码>函数changeProfile(){var location=document.getElementById(";profileLocation";);alert(location.value);var image=document.getElementById(";ProfileAAImage";);image.SRC(location.value);}我在HTML文件中编写
的代码是
<代码><;DIV类=";行";>;<;DIV类=";col-MD-3表格-组";style=";左填充:7%;";>;<;IMG ID=";ProfileImage";style=";border-radius:200px;";SRC=";images/interne/areab%20suhaib.JPG";类=";IMG-thumbnail";宽度=100高度=";100";>;<;/DIV>;<;DIV类=";COL-MD-9表组MT-3 MT-MD-0";style=";顶部填充:5%;";>;<;输入类型=";文件";名称=";文件";类=";表单控制";ID=";配置文件位置";onclick=";changeProfile()";OnKeyUp=";changeProfile()";Placeholder=";选择配置文件图像";必需>;<;/DIV>;<;/DIV>;我做
什么来完成所需的任务。
顺晟科技:
将function changeProfile(){
var location = document.getElementById("profileLocation");
alert(location.value);
var image = document.getElementById("profileAAImage");
image.src(location.value);
}
更改为<div class="row">
<div class="col-md-3 form-group" style="padding-left: 7%;">
<img id="profileImage" style="border-radius: 200px;" src="images/interne/areab%20suhaib.jpg" class="img-thumbnail" width="100" height="100" >
</div>
<div class="col-md-9 form-group mt-3 mt-md-0" style="padding-top: 5%;">
<input type="file" name="file" class="form-control" id="profileLocation" onclick="changeProfile()" onkeyup="changeProfile()" placeholder="select profile image"
required>
</div>
</div>
以获取所选文件。
<代码>函数changeProfile(){var location=document.getElementById(“ profileLocation ”);Var image=document.getElementById(“ ProfileImage ”);image.SRC=window.URL.createObjectURL(location.files[0]);}
<代码><;DIV类=“ row ”>;<;DIV Class=“ col-MD-3 form-group ” style=“ padding-left:7%;”>;<;IMG ID=“ ProfileImage ” style=“ border-radius:200px;” SRC=“ images/interne/areab%20suhaib.JPG ” Class=“ IMG-thumbnail ” width=“ 100 ” height=“ 100 ”>;<;/DIV>;<;DIV Class=“ col-MD-9 form-group mt-3 mt-MD-0 ” style=“ padding-top:5%;”>;<;INPUT TYPE=“ file ” NAME=“ file ” CLASS=“ form-control ” ID=“ ProfileLocation ” ONCHANGE=“ changeProfile()” PLACEHOLDER=“选择配置文件映像”必需>;<;/DIV>;<;/DIV>;
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11