Answer to Question #4578 in AJAX | JavaScript | HTML | PHP for yuganthi

Question #4578
how to use java to insert image
1
Expert's answer
2011-10-11T12:39:19-0400
Here is the example of a code that opens a window with an image with specified parameters:

function openImage(name,w,h)
{
& var ImgWin = window.open('', ""+name+"", config="height="+h+",width="+w+"");
& ImgWin.document.write("<HTML><TITLE>" + name + "</TITLE>")
& ImgWin.document.write("<IMG onClick='self.close()' src='Dir/" + name + ".jpg'>")
& ImgWin.document.write("</body></HTML>")
}

To use it, add

onClick="openImage('name','100','200')"

to the current img tag.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS