This is a discussion on Script is not working in IE within the JavaScript forums, part of the Beginners AJAX category; Hi guys, I had a javascript class in school and I can see whats going in the scripts, but I pretty much helpless when it comes to javascript. The code ...
|
|||||||
| JavaScript JavaScript is the name of Netscape Communications Corporation's and now the Mozilla Foundation's implementation of the ECMAScript standard, a scripting language based on the concept of prototype-based programming. The language is best known for its use in websites (as client-side JavaScript), but is also used to enable scripting access to objects embedded in other applications. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2009
Posts: 1
Rep Power: 0 ![]() |
Script is not working in IE
Hi guys,
I had a javascript class in school and I can see whats going in the scripts, but I pretty much helpless when it comes to javascript. The code below was written to color the alternate rows of a table. We needed a script because the table data is being pulled from a database. The alternating row color (gray) shows up in FF, but not IE. The code is basic stuff, but I still don't know whats wrong. Hopefully one of you guys can help me out. Code:
<script type="text/javascript">
function makeAltRows() {
var myTable = document.getElementsByTagName('tbody');
for (i=0; i<myTable.length;i++) {
var rows = myTable[i].getElementsByTagName('tr');
for (f=0; f<rows.length;f++) {
if (!(f % 2)) {
} else {
myTable[i].rows[f].setAttribute("style", "background-color:#e5e5e5;");
}
}
}
} // END makeAltRows()
makeAltRows();
</script>
this is at the bottom of the page, beneath the table. |
|
|
|
| Sponsored Links | |
![]() |
| Bookmarks |
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AJax code is working in india but bot working in Germany | nirajkg04 | AJAX Ideas | 1 | 06-10-2008 08:17 AM |
| javascript isn't working...? | bgarnik | JavaScript | 4 | 06-26-2007 02:53 AM |