-
November 27th, 2006, 10:35 AM
#1
Problem with firefox
Hello All,
I have a table in the client side and when I try to insert a cell (in javascript) and add to the innerHTML of the cell a user control it works in Internet Explorer, but when I try to do the same in Firefox it does not work.
the code:
var betTable = document.getElementById('BetAskTable');
var newRow = betTable.insertRow(location);
var newCell = newRow.insertCell(-1);
newCell.id = 'Ask' + optionID + 'OddsTD';
newCell.innerHTML = ‘<Table><TR><TD>' + '<img src="Images/Transparent1px.gif">' + '</TD></TR></Table>';
thanks
-
November 30th, 2006, 01:11 PM
#2
Re: Problem with firefox
Firefox wants you to use the dom interface for adding elements, rather than using innerHTML:
Code:
<script language='javascript'>
function test()
{
var location=-1;
var optionID='hoyhoy' ;
var betTable = document.getElementById('BetAskTable');
var newRow = betTable.insertRow(location);
var newCell = newRow.insertCell(-1);
newCell.id = 'Ask' + optionID + 'OddsTD';
var img=document.createElement('img') ;
img.src="Images/Transparent1px.gif" ;
newCell.appendChild(img) ;
}
</script>
<body>
<input type='button' value='test' onclick='test()'>
<table id='BetAskTable' name='BetAskTable'></table>
</body>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|