javascript - How to change image src on success AJAX -


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 want image source changed:

 <div id="img-container">    <img id="upslika" src="#"/>  </div> 

i images url server through json

i tried :

success:function(){                     console.log("success");                     $("#upslika").attr("src", res.pictureurl);                 }, 

res response

the success callback must this:

 success: function (res) {              $("#upslika").attr("src", res.pictureurl);           } 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -