How to display an image as a property in JavaScript objects

TG.scaR

New Member
\[code\] //construtor created function Blog(text, date, image) { this.show_image = function(src, width, height, alt){ var img = document.createElement("img"); img.src = http://stackoverflow.com/questions/15688348/src; img.width = width; img.height = height; img.alt = alt; document.body.appendChild(img); } } //instance var blog = [new Blog("hello!,Welcome to my blog1.", new Date("10/21/2012"),'show_image("images/overlay.png", 20,30, "Google Logo")'),\[/code\]Hey m calling an image in above instance for that i've written a function show_image performs that part but the image is not getting displayed...please tell me what is wrong here ...please modify it...I'm new in javascript programming.. I
 
Back
Top