File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1616 < div class ="container mt-5 ">
1717 < h2 > Json data example</ h2 >
1818 < input type ="text " id ="text " class ="form-control " />
19- < button class ="btn btn-outline-dark " id ="save " style ="display: none; ">
19+ < button class ="btn btn-outline-dark mt-3 " id ="save " style ="display: none; ">
2020 Save
2121 </ button >
2222 </ div >
2323
2424 < div class ="container mt-5 ">
2525 < h2 > Image Example</ h2 >
2626 < input type ="file " id ="select " />
27+ < br />
28+ < img id ="image " />
2729 </ div >
2830
2931 < div class ="container mt-5 ">
@@ -61,7 +63,9 @@ <h2>Result:</h2>
6163 type : type ,
6264 } ) ,
6365 } ) . then ( function ( res ) {
64- document . querySelector ( "#result" ) . innerHTML = "Succes!" ;
66+ document . querySelector (
67+ "#result"
68+ ) . innerHTML = `Succesfully uploaded <b>${ type } </b>!` ;
6569 } ) ;
6670 }
6771
@@ -84,7 +88,7 @@ <h2>Result:</h2>
8488 let path = "img/" + name ;
8589
8690 // first, temporarily show the base64 data
87- // document.querySelector(".current-item ").src = base64data;
91+ document . querySelector ( "#image " ) . src = base64data ;
8892
8993 // save the image
9094 var data = base64data . replace ( / ^ d a t a : i m a g e \/ \w + ; b a s e 6 4 , / , "" ) ;
You can’t perform that action at this time.
0 commit comments