I'm using jquery mobile, and I use javascript to add cells to a table. Now that jQuery mobile is being used, the javascript runs twice. Is there any way to prevent this?
Here's some of the code, nothing too complicated:
- rowCount = table.rows.length;
- row = table.insertRow(rowCount);
- newCell = row.insertCell(0);
- jobName = xmlDoc.getElementsByTagName("strJobName");
- jobText = jobName[0].childNodes[0].nodeValue;
- cellText = jobText.split("~");
- newText = document.createTextNode(cellText[0]);
- newCell.appendChild(newText);
- newCell = row.insertCell(1);
- cellText = cellText[1].split("-");
- cellText = cellText[1] + "/" + cellText[2] + "/" + cellText[0] + "; " + cellText[3] + ":" + cellText[4];
- newText = document.createTextNode(cellText);
- newCell.appendChild(newText);
- newCell = row.insertCell(2);
- a = document.createElement('a');
- a.innerText = 'View/Edit Order';
- a.textContent = 'View/Edit Order';
- a.href = 'Order.aspx';
- a.setAttribute('onclick','toOrderPage(jobText)');
- newCell.appendChild(a);