Object doesn't support this property or method

  • Thread starter Thread starter JohnE
  • Start date Start date
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
 
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.
 
Back
Top