The following code creates a blue button at one end of a table row that links to a detail page for the client that you are one (the row you are on). This code works in Firefox but in Internet Explorer no buttons show, so you cannot get to the detail page. Can someone suggest a solution to this that would work in both IE and Firefox?
$('#account-table tbody tr').each( function () {
//nCloneTd.innerHTML = '<a href="../two/'+this.id+'"><button class="btn btn-mini btn-primary" type="button">Detail</button></a>';
nCloneTd.innerHTML = '<a href="'+this.id+'"><button class="btn btn-mini btn-primary" type="button">Detail</button></a>';
nCloneTd.id = "detail_cell";
nCloneTd.className = "center";
nCloneTd.bgColor = "white"
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[this.childNodes.length] );
});
One of the answers asked what did the dev tools console say about the page/error. After looking at the dev tools console in IE, I found that the problem lay with this line ...
$('#account-table thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[this.childNodes.length] );
});
Changing ...
this.insertBefore( nCloneTh, this.childNodes[this.childNodes.length] );
to be ...
this.insertBefore( nCloneTh);
and ...
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[this.childNodes.length]);
to be ...
this.insertBefore( nCloneTd.cloneNode( true ));
Causes it to work correctly in IE and fail ("Not enough arguments to Node.InsertBefore") in Firefox. So the question is, is there a conditional I can put around these two statements in the javascript so that it does one thing for IE and another for Mozilla?