Hello I write one function includes one page method which is working fine in IE but not in google chrome and Firefox..
Below is my code
<script type="text/javascript">
function TestScriprt(query) {
var strQuery = query;
var table, tbody, i, rowLen, row, j, colLen, cell, cell1;
var colArray = new Array();
var rowArray = new Array();
table = document.getElementById("<%=GrdDynamic.ClientID %>");
tbody = table.tBodies[0];
for (i = 0, rowLen = tbody.rows.length; i < rowLen; i++) {
row = tbody.rows[i];
for (j = 0, colLen = row.cells.length; j < colLen; j++) {
cell1 = row.cells[j];
cell = table.rows[i].cells[j].childNodes[0].innerHTML;
var cell2 = table.rows[i].cells[j].childNodes[0].value;
if (i == 0) {
colArray[j] = new Array();
colArray[j] = cell;
}
else if (i > 0) {
if (j < 2) {
rowArray[j] = new Array();
rowArray[j] = cell;
}
else {
rowArray[j] = new Array();
rowArray[j] = cell2;
}
}
}
if (i > 0) {
PageMethods.ProcessIT(colArray, rowArray, strQuery, onSucess, onError);
function onSucess(result) {
}
function onError(result) {
}
}
}
return false;
}
</script>
[WebMethod]
public static string ProcessIT(string[] colArr, string[] rowArr,string query)
{
int k = 0;
type = "";
Sal = 0;
totSal = 0;
id = 0;
for (int i = 0; i < colArr.Length; i++)
{
name = rowArr[0];
empId =Convert.ToInt64( rowArr[1]);
if (i >= 2)
{
if (k ==0)
{
for (int j = 2; j <= addColCount+1; j++)
{
string colName = colArr[j];
getAddSalCompIDType(colName, rowArr[j],rowArr[colArr.Length-1]);
salGen = new Salary_Generation();
salGen.customer_Id = customerId;
salGen.date = date;
salGen.Emp_id = empId;
salGen.Sal_cat_type = type;
salGen.sal_toatal = totSal;
salGen.Salary = Sal;
salGen.user_Id = userId;
salGen.Salary_Comp_Id = id;
if (query == "insert")
{
string res = salGen.InsertSalaryGeneration(salGen);
}
else if (query == "update")
{
string res = salGen.UpdateSalaryGeneration(salGen);
}
else
{
string res = salGen.DeleteSalaryGeneration(salGen);
}
}
}
else if(k==1)
{
for (int j = 2 + addColCount; j <= colArr.Length - 2; j++)
{
string colName = colArr[j];
getDedSalCompIDType(colName,rowArr[j], rowArr[colArr.Length - 1]);
salGen = new Salary_Generation();
salGen.customer_Id = customerId;
salGen.date = date;
salGen.Emp_id = empId;
salGen.Sal_cat_type = type;
salGen.sal_toatal = totSal;
salGen.Salary = Sal;
salGen.user_Id = userId;
salGen.Salary_Comp_Id = id;
if (query == "insert")
{
string res = salGen.InsertSalaryGeneration(salGen);
}
else if(query == "update")
{
string res = salGen.UpdateSalaryGeneration(salGen);
}
else
{
string res = salGen.DeleteSalaryGeneration(salGen);
}
}
}
k++;
}
}
return "result";
}