Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function(){
- var xmlHttp = GetXmlHttpObject();
- xmlHttp.onreadystatechange = function(){
- var cell = xmlHttp.responseText;
- var cont = eval('('+cell+')'); ////////Here is the Problem in Firefox
- //[3,3,[["0,0","0,1","0,2"],["1,0","1,1","1,2"],["2,0","2,1","2,2"]]]
- genTable();
- }
- xmlHttp.open("GET", "load.php", true);
- xmlHttp.send(null);
- }
- function genTable(){
- var body = document.getElementsByTagName("body")[0];
- var tbl = document.createElement("table");
- var tblBody = document.createElement("tbody");
- for (var j = 0; j < 2; j++){
- var row = document.createElement("tr");
- for (var i = 0; i < 2; i++){
- var cell = document.createElement("td");
- var cellText = document.createTextNode("cell is row "+j+", column "+i);
- cell.appendChild(cellText);
- row.appendChild(cell);
- }
- tblBody.appendChild(row);
- }
- tbl.appendChild(tblBody);
- body.appendChild(tbl);
- tbl.setAttribute("border", "1");
- }
- function GetXmlHttpObject(){
- var xmlHttp=null;
- try{
- xmlHttp=new XMLHttpRequest();
- }
- catch(e){
- try{
- xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch(e){
- xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- }
- return xmlHttp;
- }
Add Comment
Please, Sign In to add comment