Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with dynamic html (i think it is)

Status
Not open for further replies.

Jonnn

Programmer
Nov 17, 2004
135
GB
Does this look correct?

Code:
function draw_stats(name, games_played, wins, loss, win_streak, win_percentage, idName) {

document.write("<tr align='center' id='" + idName + "' onmouseover=\"this.bgColor='#eaffea'\" onmouseout=\"this.bgColor='white'\">");

document.write("<td class='font'>");
document.write(name);
document.write("</td>");

document.write("<td class='font'>");
document.write(games_played);
document.write("</td>");

document.write("<td class='font'>");
document.write(wins);
document.write("</td>");

document.write("<td class='font'>");
document.write(loss);
document.write("</td>");

document.write("<td class='font'>");
document.write(win_streak);
document.write("</td>");

document.write("<td class='font'>");
var value = Math.round(win_percentage * 100) / 100
document.write(value + "%");
document.write("</td>");

document.write("</tr>");

}

the top bit where i am defining my variable "idName", is this the correct way of doing it, i am having problems with errors and not seem to figure it out!

JavaScript Beginner at work :)
 
i am having problems with errors

my clairvoyancy went down yesterday, it hasn't been back up yet. could you tell us the errors you're getting?

hunch:

document.open();

before you start writing.

document.close();

after you stop writing.

*cLFlaVA
----------------------------
[tt]a frickin' twelve-gauge, what do you think?[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Its to do with the id of the table row not being noticed, it is something to do with the way i am trying to set the ID of the table row, have i coded it correctly?

JavaScript Beginner at work :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top