Hi
I am facing an issue with document.getElementsById thru which i was trying to preview an image which I have placed in a sharepoint document librray on mouseover.The code is as follows
<span class="srch-Icon">
<img alt="n1" id="{concat('IMG_',$id)}" src="
http://a2ms04866:3000/Pdfimage/_t/pd...Fsmall_gif.jpg" onmouseover ="javascript
:cool1('{concat('IMG_',$id)}','{title} ')"/>
<script language="javascript">
function cool()
{
alert("hii");
}
function cool1(ImgName, Title)
{
alert(ImgName);
alert(Title);
var i=Title.indexOf(".");
var xcv=Title.substring(0,i);
var imagepath='http://a2ms04866:3000/Pdfimage/'+xcv+'.jpg';
alert(imagepath);
document.getElementsById(ImgName).src=imagepath;
//alert(imagepath);
}
</script>
The issue is with the last line of the code -document.getElementsById(ImgName).src=imagepath;
Please help in fixing this also let me know if we have any alternate solution in hand to have a preview popup kind of stuff.
Thanks
Jag