Click here to Skip to main content
15,914,351 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionHow can i remove pipe character in string using regex Pin
grewin8-Nov-10 16:31
grewin8-Nov-10 16:31 
AnswerRe: How can i remove pipe character in string using regex Pin
grewin8-Nov-10 17:00
grewin8-Nov-10 17:00 
GeneralRe: How can i remove pipe character in string using regex Pin
sohighthesky15-Nov-10 19:01
sohighthesky15-Nov-10 19:01 
Questionjcarousel not working Pin
wajans6-Nov-10 2:16
wajans6-Nov-10 2:16 
AnswerRe: jcarousel not working Pin
wajans7-Nov-10 19:33
wajans7-Nov-10 19:33 
GeneralRe: jcarousel not working Pin
Not Active8-Nov-10 2:35
mentorNot Active8-Nov-10 2:35 
AnswerRe: jcarousel not working Pin
Eaverae9-Nov-10 20:32
Eaverae9-Nov-10 20:32 
Questionneed Javascript to calculate day difference for dd-mm-yyyy hh:mm:ss(AM/PM) Pin
Alok Sharma ji29-Oct-10 21:24
Alok Sharma ji29-Oct-10 21:24 
AnswerRe: need Javascript to calculate day difference for dd-mm-yyyy hh:mm:ss(AM/PM) Pin
Sunasara Imdadhusen1-Nov-10 2:23
professionalSunasara Imdadhusen1-Nov-10 2:23 
QuestionJavascript Inoperative only in Explorer Pin
PDTUM29-Oct-10 19:17
PDTUM29-Oct-10 19:17 
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 

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.