the form:
<form action="/user/updateProfilePicture" id="uploadPhotoForm" method="POST" enctype="multipart/form-data">
<button class="btn btn-onetraffic btn-responsive btn-large">+Change photo</button>
<input class="btn btn-onetraffic btn-responsive btn-large" style="opacity: 0; height: 34px; margin-top: -34px;" type="file" id="uploadPhoto" name="file" accept="image/*">
</form>
Div where I want to my image source to be changed:
<div id="img-container">
<img id="upSlika" src="#"/>
</div>
I get my images url from server through JSON
I tried :
success:function(){
console.log("success");
$("#upSlika").attr("src", res.pictureUrl);
},
res is response I get