Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Simple Internet Explorer Error; can't figure it out
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
asteffes




PostPosted: Tue May 30, 2006 3:28 pm   Post subject: Simple Internet Explorer Error; can't figure it out

Hello all,

When I load up my webpage, I get:

"
Error line 13
Document[...] is null or not an object"

Here is my javascript @ line 13:

<script language="javascript" type="text/javascript">

function movepic(img_name,img_src)
{
document[img_name].src=img_src;
}

</script>

I call this function with a mouseover event to change the image:

<a href="Index.aspx"
onmouseover="movepic('Home','App_Themes/Theme/Images/Home-over.jpg')"
onmouseout="movepic('Home','App_Themes/Theme/Images/Home.jpg')">
<img id="Home" src="App_Themes/Theme/Images/Home.jpg" border="0" width="150" height="35" style="border:0" alt="Home"/></a>

Any help would be greatly appreciated, thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Wed May 31, 2006 11:38 am   Post subject: (No subject)

Typically you need to do something like the following to modify an object's styles:
code:
document.getElementById[img_name].style
Of course, you will need each image to have an id="" attribute added to their tags.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: