title: javascript error in Mobile Adapter in sharepoint 2010
body: <p>I am developing a very simple web part mobile adpater. It just outputs "hello world". The mobile web part renders fine, but when i click on arrow image next to the Web part title , it throws javascript error "object expected" on "ExpandCollapse" function. I am viewing the page, by adding "?mobile=1" in my pc browser. I m using IE8. Please help.</p>
  
  <p>When I looked at the HTML source of the rendered page, I noticed, the above errror is caused because  javascript function ExpandCollapse was not rendered. </p>
  
  <p>Below is the HTML source </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="ctl00" name="ctl00" method="post" action="mblwp.aspx?__ufps=303904&amp;Url=%2fPages%2fper.aspx&amp;amp;mobile=1"&gt;
  &lt;input type="hidden" name="__VIEWSTATE" value="/wEXAQULY3RsMDIkY3RsMDcUKwACZWQ0DWekHDAtSoDK+DzThd4XW94rSg=="&gt;
  &lt;input type="hidden" name="__EVENTTARGET" value=""&gt;
  &lt;input type="hidden" name="__EVENTARGUMENT" value=""&gt;
  &lt;input type="hidden" name="__V_ctl00_LastPage" value="1"&gt;
  &lt;script language=javascript&gt;&lt;!--
  function __doPostBack(target, argument){
   var theform = document.ctl00
   theform.__EVENTTARGET.value = target
   theform.__EVENTARGUMENT.value = argument
   theform.submit()
  }
  // --&gt;
  &lt;/script&gt;
  
                  &lt;div style="color:White;background-color:#21374C;font-size:13pt;font-weight:bold;padding-right:6px;padding-left:6px;padding-bottom:12px;padding-top:12px;"&gt;
  
  
  
          Pages: per&lt;br&gt;
  
  
  
  
  &lt;/div&gt; &lt;br&gt;
  
              &lt;div id="g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Summary" style="color:Black;font-size:Medium;"&gt;
      &lt;a href="javascript:ExpandCollapse(g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Summary);javascript:ExpandCollapse(g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Detail)"&gt;&lt;img src="/_layouts/images/mblwpsummarytitle.gif" border="0" /&gt;&lt;/a&gt;&lt;b&gt;PersonnelSearchWebPart
  &lt;/b&gt;&lt;br&gt;
  &lt;/div&gt;&lt;div id="g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Detail" style="color:Black;font-size:Medium;display:none;"&gt;
      &lt;a href="javascript:ExpandCollapse(g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Summary);javascript:ExpandCollapse(g_db56af97_19b2_40a6_a44a_aa5f6f61fb29__Detail)"&gt;&lt;img src="/_layouts/images/mblwpdetailtitle.gif" border="0" /&gt;&lt;/a&gt;&lt;b&gt;PersonnelSearchWebPart&lt;/b&gt;&lt;br&gt;
      Hello World. This is the Mobile Device version of the SharePoint web part.
  &lt;br&gt;
  &lt;/div&gt;
  
  
      &amp;nbsp;&lt;div style="background-color:#F6F6F6;padding-right:6px;padding-left:6px;padding-bottom:12px;padding-top:12px;"&gt;
  
  
  
  
  
  
  
  
                          &lt;hr width="100%" size="1" color="#FFFFFF" align="center"&gt;
                          &lt;div&gt;
  
      &lt;/div&gt;
  
  
  
  
  
  
          &lt;a href="http://devcollab:286/_layouts/mobile/mbllists.aspx"&gt;All Site Content&lt;/a&gt;&lt;br&gt;
  
  
          &lt;a href="http://devcollab:286/_layouts/mobile/mobilesearch.aspx"&gt;Search&lt;/a&gt;&lt;br&gt;
  
          &lt;a href="http://devcollab:286/?Mobile=1"&gt;Home(Home)&lt;/a&gt;&lt;br&gt;
  
  
          &lt;!-- place SSL VPN logout link here --&gt;
  
  
  
  
  
  &lt;/div&gt;
              &lt;/form&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>