title: Javascript error when using ScriptManager.RegisterStartupScript
body: <p>Note: the following is only an issue on the live server. In my local development, everything works fine.</p>
  
  <p>I have a javascript function in my markup like so:</p>
  
  <pre><code>    function openNewWin(url) { 
          var x = window.open(url, 'mynewwin', 'width=500,height=500,toolbar=0,scrollbars=0'); 
          x.focus();
      }
  </code></pre>
  
  <p>On a button click event, I call the following:</p>
  
  <pre><code>     ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenWin", "openNewWin('" + url + "')",true);
  </code></pre>
  
  <p>This doesn't work and I get the following in chrome:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected identifier ScriptResource.axd:448
  _ScriptLoader$_loadScriptsInternal ScriptResource.axd:448
  _ScriptLoader$_loadScriptsInternal ScriptResource.axd:453
  _ScriptLoader$_loadScriptsInternal ScriptResource.axd:453
  _ScriptLoader$_loadScriptsInternal ScriptResource.axd:453
  _ScriptLoader$_nextSession ScriptResource.axd:476
  _ScriptLoader$_loadScriptsInternal ScriptResource.axd:462
  _ScriptLoader$_nextSession ScriptResource.axd:476
  _ScriptLoader$loadScripts ScriptResource.axd:372
  PageRequestManager$_onFormSubmitCompleted ScriptResource.axd:1480
  $type.createDelegate ScriptResource.axd:628
  $type.getHandler ScriptResource.axd:4338
  raise ScriptResource.axd:7429
  WebRequest$completed ScriptResource.axd:7433
  Sys.Net.XMLHttpExecutor._onReadyStateChange
  </code></pre>
  
  <p>and in IE I get:</p>
  
  <pre><code>Message: Expected ')'
  Line: 1
  Char: 51
  Code: 0
  URI: http://mysite.com/postage/printpostage.aspx
  </code></pre>
  
  <p>I can't figure what's wrong with my javascript. It works perfectly in development.</p>
  
  <p>More details: I'm using ASP.NET WebForms. The button that the code is executed on is nested in an UpdatePanel.</p>
  
  <p>Thanks for any help.</p>
  
  <p><b>Edit</b>:</p>
  
  <p>I removed the ScriptManager.RegisterStartupScript and just tried doing something simple on the button click but I get the same error. I guess it's something else that's causing it. How do I trouble shoot this?</p>
  
  <p><b>Edit #2: </b></p>
  
  <p>I started from scratch and it looks like it's any code with Scriptmanager.registerstartupscript. For example, I try it with the following and I get the same problem:</p>
  
  <pre><code>    catch (Exception ex)
      {
          ScriptManager.RegisterStartupScript(this, this.GetType(), "AlertError", "alert('Error: " + ex.Message + "');", true);
      }
  </code></pre>