Click here to Skip to main content
15,891,633 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Javascript Inoperative only in Explorer PinPopular
NeverHeardOfMe29-Oct-10 22:57
NeverHeardOfMe29-Oct-10 22:57 
GeneralRe: Javascript Inoperative only in Explorer Pin
Sunasara Imdadhusen1-Nov-10 2:16
professionalSunasara Imdadhusen1-Nov-10 2:16 
AnswerRe: Javascript Inoperative only in Explorer Pin
PDTUM1-Nov-10 8:55
PDTUM1-Nov-10 8:55 
QuestionJava Script Error Pin
MathewPV29-Oct-10 19:14
MathewPV29-Oct-10 19:14 
AnswerRe: Java Script Error Pin
Not Active31-Oct-10 4:26
mentorNot Active31-Oct-10 4:26 
AnswerRe: Java Script Error Pin
Sunasara Imdadhusen1-Nov-10 2:14
professionalSunasara Imdadhusen1-Nov-10 2:14 
GeneralRe: Java Script Error Pin
Ankur\m/18-Nov-10 2:11
professionalAnkur\m/18-Nov-10 2:11 
QuestiondeleteRow() weird behavior, deletes two rows. Pin
da808wiz28-Oct-10 15:36
da808wiz28-Oct-10 15:36 
I guess this could be considered a tip as well as a possible question.

I've found that if I have a table with the first row having a colspan value, i.e. header for the table, then deleting the last remaining row below the colspan row deletes the colspan row too.

Check it out - paste the following into an .html, add a few rows, then delete a few rows.
<html>
<head><title>JS Dynamic Table Test</title>
<script language="JavaScript">
<!--
function AddRow() {
	var a_misctext = ["Gary","Mary","Larry","Harry","June","Marge","Lisa","Tina","Rika","Susan"];
	tbl = document.getElementById('DataArea');
	lastrow = tbl.rows.length;
	workrow = tbl.insertRow(lastrow);
	workrow.insertCell(0);
	workrow.cells[0].innerHTML = "<nobr>"+a_misctext[Math.floor(Math.random()*10.0)]+"</nobr>";
	workrow.insertCell(1);
	workrow.cells[1].innerHTML = "<input type=\"button\" value=\"x\" onClick=\"PopRow(this.parentNode.parentNode.rowIndex);\">";

	return false;
}

function PopRow(x) {
	document.getElementById('DataArea').deleteRow(x);
}
//-->
</script>
</head>
<body>
<form>
<table id=DataArea cellpadding=4 cellspacing=0 border=0>
<tbody>
<tr><td colspan="2">My Stuff   <input type="button" value=" Add " onClick="AddRow();"></td></tr>
</tbody>
</table>
</form>
</body>
</html>


I "fixed" it by turning the colspan row into 2 separate columns:
<br />
<tr><td>My Stuff</td><td><input type="button" value=" Add " onClick="AddRow();"></td></tr><br />


Any idea why the table would collapse when deleting the last row?
AnswerRe: deleteRow() weird behavior, deletes two rows. Pin
sohighthesky15-Nov-10 19:40
sohighthesky15-Nov-10 19:40 
GeneralRe: deleteRow() weird behavior, deletes two rows. Pin
da808wiz16-Nov-10 6:55
da808wiz16-Nov-10 6:55 
Questionget controls using name Pin
i gr827-Oct-10 21:30
i gr827-Oct-10 21:30 
AnswerRe: get controls using name [modified] Pin
Sunasara Imdadhusen27-Oct-10 22:53
professionalSunasara Imdadhusen27-Oct-10 22:53 
AnswerRe: get controls using name Pin
moocr.com1-Nov-10 15:27
moocr.com1-Nov-10 15:27 
AnswerRe: get controls using name Pin
jaypatel51214-Nov-10 8:02
jaypatel51214-Nov-10 8:02 
QuestionHow to handle events in Pocket Internet Mobile Pin
Rahul Chitte26-Oct-10 22:21
Rahul Chitte26-Oct-10 22:21 
AnswerRe: How to handle events in Pocket Internet Mobile Pin
moocr.com1-Nov-10 20:36
moocr.com1-Nov-10 20:36 
GeneralRe: How to handle events in Pocket Internet Mobile Pin
Zhenjie Fu18-Nov-10 20:59
Zhenjie Fu18-Nov-10 20:59 
QuestionWhile Press "Esc" key ajax request and response is stopped in the browser Pin
PeriyasamyRamachandran26-Oct-10 18:40
PeriyasamyRamachandran26-Oct-10 18:40 
AnswerRe: While Press "Esc" key ajax request and response is stopped in the browser Pin
Jules VDV27-Oct-10 4:33
Jules VDV27-Oct-10 4:33 
GeneralRe: While Press "Esc" key ajax request and response is stopped in the browser [modified] Pin
PeriyasamyRamachandran27-Oct-10 19:48
PeriyasamyRamachandran27-Oct-10 19:48 
GeneralRe: While Press "Esc" key ajax request and response is stopped in the browser Pin
Jules VDV28-Oct-10 3:54
Jules VDV28-Oct-10 3:54 
GeneralRe: While Press "Esc" key ajax request and response is stopped in the browser Pin
PeriyasamyRamachandran28-Oct-10 18:24
PeriyasamyRamachandran28-Oct-10 18:24 
QuestionDo not stop the Ajax request and response when "Esc" key is pressed Pin
PeriyasamyRamachandran25-Oct-10 22:15
PeriyasamyRamachandran25-Oct-10 22:15 
GeneralDisable Tabbed browsing using javascript Pin
manowj25-Oct-10 1:57
manowj25-Oct-10 1:57 
GeneralRe: Disable Tabbed browsing using javascript Pin
Steve Echols25-Oct-10 15:58
Steve Echols25-Oct-10 15:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.