Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: How to writ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 36366 of 37133
Post > Topic >>

Re: How to write rows into pre-formatted table in second window

by Beez <kbiesbrock@[EMAIL PROTECTED] > Jul 25, 2008 at 06:08 AM

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');
 




 3 Posts in Topic:
How to write rows into pre-formatted table in second window
Steve <stephen.joung@[  2008-07-24 13:04:11 
Re: How to write rows into pre-formatted table in second window
Beez <kbiesbrock@[EMAI  2008-07-25 06:08:45 
Re: How to write rows into pre-formatted table in second window
Thomas 'PointedEars' Lahn  2008-07-25 20:46:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 2:06:05 CDT 2008.