J
James Kimble
Yeah I'm sure this is a stupid question.
I've got a javascript source file with functions (creates a bar graph)
I want to call from inside an html table cell so that the graph
appears in the cell. I've tried a bunch of different things but I'm
not getting it. I'm a newbee to both html and javascript so be kind.
Any example would be appreciated.
My current attempt looks like:
<head>
<script language="JavaScript" src="bargraph.js"></script>
<script language="JavaScript">
function createBarGraph() {
graph = new BarGraph("HorizBar");
graph.values = "1000";
document.write(graph.create());
}
</script>
</head>
<body onLoad="createBarGraph()">
<table width="100%" border="0">
<tr>
<td>HPX40</td>
<td>CUSTOMER DEFINED TEXT </td>
<td> </td>
</tr>
<tr>
<td>Plate Status:</td>
<td><form name="f1" action="javascript:createBarGraph()"
method="post"></td>
<td>40.5KW</td>
</tr>
</table>
</body>
This just displays my graph by itself. No other table items appear.
I've got a javascript source file with functions (creates a bar graph)
I want to call from inside an html table cell so that the graph
appears in the cell. I've tried a bunch of different things but I'm
not getting it. I'm a newbee to both html and javascript so be kind.
Any example would be appreciated.
My current attempt looks like:
<head>
<script language="JavaScript" src="bargraph.js"></script>
<script language="JavaScript">
function createBarGraph() {
graph = new BarGraph("HorizBar");
graph.values = "1000";
document.write(graph.create());
}
</script>
</head>
<body onLoad="createBarGraph()">
<table width="100%" border="0">
<tr>
<td>HPX40</td>
<td>CUSTOMER DEFINED TEXT </td>
<td> </td>
</tr>
<tr>
<td>Plate Status:</td>
<td><form name="f1" action="javascript:createBarGraph()"
method="post"></td>
<td>40.5KW</td>
</tr>
</table>
</body>
This just displays my graph by itself. No other table items appear.