title: Delimiters in javascript
body: <p>What I want now is not be show out the delimiter, when I print out the sentence from my database. For example in the database, one element store <code>"Jane likes#to#play the#piano"</code>. So it will actually separate into 4 string elements. However, doing any function first like drag and drop the string array elements. I want to print out the sentence first "Jane likes to play the piano." in order for the person to memorise the sentence, so that they can start playing the game. </p>
  
  <p>The code below displays "Jane likes#to#play the#piano." instead of what I want which is this "Jane likes to play the piano."</p>
  
  <p><code>$output</code> is the sentence retrieved from the database.</p>
  
  <pre><code>&lt;script&gt;
   //Parses the variable from php to this Javascript part
   var js_var = "&lt;?php echo $output ?&gt;";
  
   //document.write(js_var);
  
   //Splits the string when the delimiter # is detected
   var split_str= js_var.split("#");
  
  
   //var js_var = "Try123";
   //displays original string
   document.writeln(js_var+"&lt;br &gt;"+"&lt;br &gt;");
  
  
   //sent to shuffle(o) function to scramble the elements
   var shuffle_str = shuffle(split_str);
  
   //displays each of the shuffled string array elements
   for (i=0;i&lt;shuffle_str.length;i++)
   {
     document.write(shuffle_str[i] + "&lt;br &gt;");
   }
  
   //document.writeln(js_var);
  
   function shuffle(o){ //v1.0
     for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
     return o;
   };
  &lt;/script&gt;
  </code></pre>