On Jul 24, 4:04=A0pm, Steve <stephen.jo...@[EMAIL PROTECTED]
> wrote:
> I want to open a window that has been pre-formatted with a table and
> then write rows to the table. The pre-formatted =A0url is named
> budget.html and the body looks like this:
>
> <body>
> <h1 align=3D"center">Budget for <div id=3Dvertical></div></h1>
> =A0 <table width=3D"100%" cellpadding=3D"0" cellspacing=3D"0">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <tr
style=3D"background-color:#000000;col=
or:#FFFFFF;">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td
width=3D"50%">Paramet=
er</td>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td
width=3D"25%">Site-A<=
/td>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td
width=3D"25%">Site-B<=
/td>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </tr>
> =A0 </table>
> =A0</body>
>
> The javascript I have tried is:
>
> function printList() {
> =A0 =A0 =A0 =A0 =A0window.open('budget.html','budget','width=3D1000');
> =A0 =A0 =A0 =A0 =A0function writerow(name,feet,inches,weight) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0budget.do***ent.write("<tr
align=3D'center'>")=
;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
budget.do***ent.write("<td>"+name+"</=
td>");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 budget.do***ent.write("<td>"+feet+"
f=
oot, "+inches+" inch(es)</
> td>");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
budget.do***ent.write("<td>"+weight+"=
Kg</td>");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 budget.do***ent.write("</tr>");
> =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0writerow("Michael Owen","5","7","70");
> =A0 =A0 =A0 =A0 =A0writerow("Emile Heskey","6","2","150");
> =A0 =A0 =A0 =A0 =A0writerow("Steven Gerrard","6","0","85");
> =A0 =A0 =A0 =A0 =A0do***ent.close();
> =A0 =A0 =A0 =A0 =A0//a.print();
>
> }
>
> This gives a firebug message of "budget has no properties". Why?
>
> Thanks in advance for any assistance.
I've never done anything like this before, but I think you need to
give your created window object a variable name.
var budget =3D window.open('budget.html','budget','width=3D1000');


|