Object doesn't support this property or method

J

JohnE

I have a gridview that has an arrow on it for show/hide the nested gridview.
When I use the arrow I get the error listed in the subject line above. Here
is the javascript that is being used. The error comes back to the 2 'var'
lines.

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

function switchViews(obj, row)
{
var div = window.opener.document.getElementByID(obj);
var img = window.opener.document.getElementByID('img' + obj);

if(div.style.display == "none")
{
div.style.display = "inline";

if (row == 'alt')
{
img.src = "../Images/expand_button_white_alt_down.jpg"
mce_src = "../Images/expand_button_white_alt_down.jpg";
}
else
{
img.src = "../Images/Expand_Button_white_Down.jpg"
mce_src = "../Images/Expand_Button_white_Down.jpg";
}
img.alt = "Close to view other change requests";
}
else
{
div.style.display = "none";

if (row == "alt")
{
img.src = "../Images/expand_button_white_alt.jpg"
mce_src = "../Images/expand_button_white_alt.jpg";
}
else
{
img.src = "../Images/expand_button_white.jpg"
mce_scr = "../Images/expand_button_white.jpg";
}

img.alt = "Use to show children."
}
}

</script>

This is located on a webapp webform (nested masterpage) inside the
<asp:Content></asp:Content tag.

Does anyone see what is wrong with this or what is missing? Hope so,
because I don't.

Thanks...John
 
J

JohnE

Nevermind. I found the error as to why I was getting the error. I have the
..getElementByID when it should be .getElementById. Uppercase versus
lowercase 'd'. Case sensitive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top