title: JavaScript stops at ToString
body: <p>Question for JavaScript experts out there. I have a SCORM (e-learning content package) which is failing at a very specific point in the JavaScript. I have set up logging to see where it is failing and it is actually failing at one of my logs so its as if converting the object to a string is causing a problem. Am I missing something here?</p>
  
  <pre><code>var w = window.open("", "popupWindow", "width=600, height=400, scrollbars=yes");
  var $w = $(w.document.body);
  
  function writelog(s){
      $w.append(s);
  }
  
  
  function SCOSetValue(nam,val){
      writelog("in SCOSetValue");
      writelog("name is "+nam.toString());
      writelog("value is "+val.toString());
      writelog("&lt;br/&gt;”);
  ...
  </code></pre>
  
  <p>At the line <code>val.toString()</code> the JS just stops. Anybody have a clue whats going on? The val will basically look something like the following.
  undefined true true false 90 100 -1 -1 522 1 false 1 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</p>
  
  <p>Thanks,
  Mark</p>