Oliazk Posted October 6, 2006 Share Posted October 6, 2006 Hello all,I am trying to do an assignment I got from my teacher but I just for the life of me cant figure out how I am going to go about doing. If you dont mind helping that would be great I went ahead and made the page I am going to put the assignment on just need to figure out how to do it but look here.... http://www.oliazk.com/assign3.htmlI dont want the answer just some idea how to do it. I am externally linking the javascript file.Thanks for any help. Link to comment Share on other sites More sharing options...
Oliazk Posted October 6, 2006 Author Share Posted October 6, 2006 Uh never mind I think I figured it out. I got it to print out the information in javascript and output the info to the page.edit:here is a new link to it http://www.oliazk.com/assignments/assign3.html Link to comment Share on other sites More sharing options...
jhecht Posted October 6, 2006 Share Posted October 6, 2006 ok... basically what is going to happen is that you are going to have a for loop. something likefor( i = 1;i<5;i++){//Code executed here...}What you would have to do would be one of 2 things, since you are apparetly learning Javascript, i'll go with the less complex one.have the javascript print out a table tag before the loop. IEdocument.write("<table>");and then have it echo the closing table tag AFTER the for loop;FOR LOOP HEREdocument.write("</table>";from there you woudl take the variable "i" and multiply it by 10,100, and 1000, thusly storing these 3 values in 3 different variables and then echoing them like:document.write("<tr>\n<td>"+times10Var+"</td>\n<td>\n"+times100Var+"</td><td>\n"+times1000var+"</td>\n</tr>\n");Have fun. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now