AJAX Forums

Script is not working in IE

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 ...

Go Back   AJAX Forums > Beginners AJAX > JavaScript

AJAX Made Easy


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.

Reply

 

LinkBack Thread Tools Display Modes
Old 07-01-2009, 10:10 AM   #1 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 1
Rep Power: 0
pricecd is on a distinguished road
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.
pricecd is offline   Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


All times are GMT -4. The time now is 02:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright ©2006 - 2009, AJAXwith.com