-1

Good day

Script:

var img_src="../Images/" + data;
$("#div_yui_img").html(\'<img src="img_src" id="yui_img" height="100" width="100">\');

but after add in html i see:

<div id="div_yui_img"><img src="img_src" id="yui_img" height="100" width="100"></div> 

tell me please how right add image in div, that get(example):

<div id="div_yui_img"><img src="../Images/test.jpg" id="yui_img" height="100" width="100"></div> 

Thanks!

zessx
  • 68,042
  • 28
  • 135
  • 158
Leo Loki
  • 2,457
  • 6
  • 24
  • 29
  • http://stackoverflow.com/a/554289/1083581 – happybuddha Mar 06 '13 at 14:37
  • 1
    @happybuddha please see question first. link not have answer on MY question. i ask other question. – Leo Loki Mar 06 '13 at 14:52
  • I read your question darn well. You are trying to update the src of an img tag and are able to fetch the variables name instead of its value. If you read through the link that I provided, you will find your answer. – happybuddha Mar 06 '13 at 15:01
  • @happybuddha i dont see. show me please when you see answer on my questuion? – Leo Loki Mar 06 '13 at 18:10
  • Whatever makes the function call, I think this should serve your purpose. > $('yui_img').attr('src','../Images/test.jpg'); – happybuddha Mar 06 '13 at 19:33
  • @happybuddha do you think that you say? see my question! i dont ask "how change img attribute". i ask how past image in div. These are very different questions. if you see answer on **my** question on your page give me screenshot because i don't see answers on my question on your page. – Leo Loki Mar 06 '13 at 19:40
  • If I have understood you incorrectly, and with what you are trying to communicate, I am afraid, I don't understand what your question is. Good luck – happybuddha Mar 06 '13 at 19:45
  • @happybuddha if you understand need ask! Bye. – Leo Loki Mar 06 '13 at 20:44

1 Answers1

1

Using your method :

var img_src="../Images/" + data;
$("#div_yui_img").html('<img src="'+img_src+'" id="yui_img" height="100" width="100">');
zessx
  • 68,042
  • 28
  • 135
  • 158