Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.edit_button').on("click", function(e) {
- var id = $(this).data('id');
- $.ajax({
- url: base_url + "product/edit/"+id,
- type: "GET",
- dataType: "JSON",
- success: function(data)
- {
- var foto= data.foto;
- var src= base_url + "uploads/product";
- // alert(src); //this get full path jake but
- //when i write like in bellow with comments, i get url src/defaultgambar.png/ after insepect element !
- //what should i write in js to get full folder jake ?
- if (foto==null) {
- //$('#images-from-db-here-put-here').html("<img src='src/defaultgambar.png'>");
- $('#images-from-db-here-put-here').html("<img src='http://localhost/cilihat/uploads/default/defaultgambar.png' width='150px' height='150px'>");
- }
- else
- {
- //$('#images-from-db-here-put-here').html("<img src='src/"+data.foto+"'>");
- $('#images-from-db-here-put-here').html("<img src='http://localhost/cilihat/uploads/product/"+data.foto+"' width='150px' height='150px'>");
- }
- },
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement