Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2009, 08:12 AM
Registered User
 
Join Date: Mar 2009
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Issue in getElementsById

Hi

I have an issue with getElementsById whereit is throwing an error .Do we have any kind of alternate function to solve this issue.I need to preview the images which I have stored in a sharepoint library.

Please Help !

Jag


Code:
 

<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>
 
Old March 19th, 2009, 01:09 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

You are probably meaning to use document.getElementById (NO s!).
If that does not fix it, please post what error is being thrown, so we have a better chance of knowing how to fix it!

Thanks
Phil
The Following User Says Thank You to philip_cole For This Useful Post:
jagadish m (March 19th, 2009)
 
Old March 19th, 2009, 01:11 PM
Registered User
 
Join Date: Mar 2009
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi

Thanks for the reply .....I fixed it some time back and it is working good !

Regards
Jag





Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with document.getElementsById jagadish m Javascript 3 April 21st, 2009 04:29 AM
Issue with Page_PreRender webdeveloper C# 0 October 17th, 2007 12:37 PM
x path issue ashyabhi XSLT 5 September 23rd, 2007 01:47 AM
Another issue islandtiu BOOK: Beginning ASP 3.0 1 February 14th, 2005 11:49 AM
Datagrid issue Warbird General .NET 4 July 30th, 2004 10:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.