title: ClientGlobalContext.js.aspx broken in Dynamics 2011?
body: <p>I am trying to implement a custom web resource using jquery/ajax and odata. I ran into trouble and eventually found that when I call:</p>
  
  <pre><code>var serverUrl = context.getServerUrl();
  </code></pre>
  
  <p>The code throws exceptions. </p>
  
  <p>However, when I change serverUrl to the literal url, it works. I then found forum posts that said I should verify my .aspx page manually by going to <code>https://[org url]//WebResources/ClientGlobalContext.js.aspx</code> to verify that it is working. When I did that I received a warning page:</p>
  
  <pre><code>The XML page cannot be displayed 
  Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. 
  
  
  --------------------------------------------------------------------------------
  
  Invalid at the top level of the document. Error processing resource 'https://[org url]//WebResources/Clien...
  
  
  document.write('&lt;script type="text/javascript" src="'+'\x26\x2347\x3b_common\x26\x2347\x3bglobal.ashx\x26\x2363\x3bver\x2...
  </code></pre>
  
  <p>What the heck does that mean?</p>