title: Uncaught SyntaxError: Unexpected identifier IN Chrome
body: <p>I have following script in my page to highlight a map.</p>
  
  <pre><code>&lt;script&gt;
      function highlight(list,win,lose)
      {
          var WinParty = win;
          var LoseParty = lose;              
  
          var jsVariable = list;
  
          var area = document.getElementsByTagName('area')
          var ary=[]
          for (var zxc0=0;zxc0&lt;area.length;zxc0++){
              ary.push(area);  
             }
  
          var isfound = false;  
  
          for(var i = 0; i &lt; area.length; i++)   
          {   
              isfound = false;  
  
              for(var j = 0; j &lt; jsVariable.length; j++)   
              {                   
                  if (area[i].getAttribute('title').trim() == jsVariable[j].trim())
                  {  
                      isfound = true;                   
                      $(area[i]).each(function ()//get all areas
                      {
                          $(this).addClass("victory");
                      });
                  }            
              }   
              if(!isfound)   
              {   
                  $(area[i]).each(function ()//get all areas
                  {
                      $(this).addClass("lose");
                  });                
              }              
          }                             
  
          $(function () {
              var data = {};
              $('.map').maphilight();
              data.alwaysOn = true;
              data.fillColor = WinParty;
              $('.victory').data('maphilight', data).trigger('alwaysOn.maphilight');
  
  
              var data = {};
              $('.map').maphilight();
              data.alwaysOn = true;
              data.fillColor = LoseParty;
              $('.lose').data('maphilight', data).trigger('alwaysOn.maphilight');
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I am calling this script from Code Behind (VB.Net) as follows</p>
  
  <pre><code>Dim Serializer = New System.Web.Script.Serialization.JavaScriptSerializer()
  Dim List = Serializer.Serialize(Values)
  WinPartyColor = Hex(Color.Blue.ToArgb()).Substring(2)
  LosePartyColor = Hex(Color.Red.ToArgb()).Substring(2)
  
  Dim Script As String = String.Format("highlight({0},{1},{2});", List, WinPartyColor, LosePartyColor)
  
  ScriptManager.RegisterStartupScript(ElectionResultUpdatePanel, ElectionResultUpdatePanel.GetType(), "HighLighting", Script, True)
  </code></pre>
  
  <p>When i'm running above  code in Chrome i'm getting error as</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected identifier
  </code></pre>
  
  <p>but when i run same code in IE, getting error as </p>
  
  <pre><code>SCRIPT1007: Expected ']'.
  </code></pre>
  
  <p>My guess is about List argument, which is array in Javascript.</p>
  
  <p>Please help me out. </p>