| 
	
 | 
 Posted by Ravi on 05/24/07 12:08 
in my script i declared one variable as global.I am tying to acess it 
in a function but it is not comming in Mozilla . it is executing in 
ie. 
 
My code is 
 
var http = createRequestObject(); 
function createRow(key,val,tableId,index,numele,evt) 
{ 
		var table = document.getElementById(tableId); 
		var newRowFlag = false; 
		evt = (evt) ? evt : window.event 
		var charCode = (evt.which) ? evt.which : evt.keyCode 
		switch(charCode) 
		{ 
			case 13 : 
			case 9  : if(parseInt(table.rows.length) == (parseInt(index))) 
newRowFlag=true; 
		} 
		if(newRowFlag) 
		{ 
			http.open('get',"gridClass.php?rowkey="+key+"&rowval="+val 
+"&index="+index+"&tabid="+tableId); 
			http.onreadystatechange = function(){ 
						insertRow(tableId,index,numele);}; 
			http.send(null); 
		} 
} 
 
function insertRow(tableId,index,numele) 
{ 
alert(http.readystate); 
	if(http.readystate == '4') 
	{ 
			var response = http.responseText; 
			var table = document.getElementById(tableId); 
			var td = response.split('^'); 
			newRow = table.insertRow(); 
			for(i=0;i<numele;i++) 
			{ 
				isText = newRow.insertCell(i); 
				isText.innerHTML = td[i]; 
			} 
	} 
} 
 
 
 
Thanks in advance 
Ravindra
 
  
Navigation:
[Reply to this message] 
 |