Advertisement
freddy0512

ajax images in modal

Oct 30th, 2015
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //edit data product
  2. $('.edit_button').on("click", function(e) {
  3. var id = $(this).data('id');
  4. var src= base_url + "uploads/product";
  5. // alert(src); here i can get whole url
  6. $.ajax({
  7. url: base_url + "product/edit/"+id,
  8. type: "GET",
  9. dataType: "JSON",
  10. success: function(data)
  11. {
  12.  
  13. //images from database
  14. var foto= data.foto;
  15. if (foto==null) {
  16. // alert(foto); here is i can get right name foto
  17. $('#images-from-db-here-put-here').html('Freddy is here with foto null');
  18. }
  19. else
  20. {
  21. // alert(src/foto); here i get src/foto hope i get spesific foto in folder what do i wrong in here
  22. $('#images-from-db-here-put-here').html("<img src='src/data.foto'>");
  23.  
  24. }
  25.  
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement