“this” keyword error now when it was working fine

I have a problem that was not a problem before.

I have a sight that was working. I started a website project and I think I selected asp.net site. In this project I had some code in a aspx page.

                 <script language="JavaScript" src="~/Scripts/menu.js" type="text/javascript">
           
                function lefthide() {
                var fr = parent.document.getElementById("sbCont");
                    if(fr.style.display==""){
                        fr.style.display="none";
                  change('outlookside', 'outlookBarExpand')
                    }
                    else{
                        fr.style.display="";
                  change('outlookside', 'outlookBarcollapse')
                    }

                }
                function change(id, newClass) {

                identity=document.getElementById(id);

                identity.className=newClass;

                }
          </script>

 

Then this later in the page.

<td align="center" background="images/collapse_side_bg.gif" style="width: 6px;
                        height: 91%; background-color: #e7ebf0" valign="middle">
                        <img id="outlookside" class="~/Styles/Collapse.css" height="45" onclick="lefthide(this);"
                            src="images/slidbtn.JPG" style="cursor: pointer" width="5" /></td>

Now I created a new site asp.net with Ajax support. Now the onclick="lefthide(this) causes an error "Object required" What is wrong.

 

Thanks,

 

Ty

Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s