create table with values using js
<p>I want to create table using javascript and fill it with data. So I decided to use <code>prompt</code> method and loop <code>while</code>. </p>

<p>But when I try to load page I always get two error message in google chrome developer tools
<img src="http://i.stack.imgur.com/DBpib.png" alt="enter image description here"></p>

<p>Here is the code</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;script type="text/javascript"&gt;
    function onStart() {
        var list = new Array();
        var headers = new Array("Имя","Отчество","Фамилия","Дата рождения");
        var i = -1;
        while(true) {
            var a = prompt("Имя","noname");
            var b = prompt("Отчество","nomiddlename");
            var c = prompt("Фамилия","nosurname");
            var d = prompt("Дата рождения!",0);
            if (confirm("Уверены что хотите добавить студента?")) {
                i++;
                list[i] = a + "-" + b + "-" + c + "-" + d;
            }else{ break; };
        }
        tab = "&lt;table&gt;";
        for(j = 0; j&lt;headers.length;j++) {
            tab += "&lt;th&gt;" + headers[j] + "&lt;/th&gt;";
        for(var j = 0; j &lt; list.length; j++) {
            var params = list[i].split('-');
            tab += "&lt;tr&gt;";
            for(k = 0; k &lt; params.length;k++) {
                tab +="&lt;td&gt;" + params[k] + "&lt;/td&gt;";
            }
            tab +="&lt;/tr&gt;";
        }
        tab +="&lt;/table&gt;";
        document.write(tab);
    };
    &lt;/script&gt;
&lt;/head&gt;
&lt;body onLoad = "onStart()"&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>What's the problem? </p>
