document.write not working

table using document.write

Page 1 of 1

7 Replies - 3842 Views - Last Post: 09 March 2009 - 10:03 AM

#1 suxinjava  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 10-August 08

document.write not working

Posted 09 March 2009 - 08:47 AM

Q: create a web page name highestwaterfalls.html that uses document.write() statements to print a table containing the names,locations and height of the highest waterfalls in the world.


me:
i still cant show the output.why?tell me why.. ;[




<html>

<body>


<script language="javascript">

documnt.write("<h1> 10 Highest Waterfall In The World</h1>");

document.write("<table border='1'> ");
document.write("<tr>");
document.write("<td>Number</td>");
document.write("<td>Name of waterfalls</td>");
document.write("<td>Location</td>");
document.write("<td>height(metre)</td>");




document.write("<tr>");
document.write("<td>1.</td>");
document.write("<td>	Angel</td>");
document.write("<td>Canaima Natíl Park, Venezuela</td>");
document.write("<td>3,212</td>");




document.write("<tr>");
document.write("<td>2.</td>");
document.write("<td>		Tugela</td>");
document.write("<td>Natal Natíl Park, South Africa</td>");
document.write("<td>3,110</td>");


document.write("<tr>");
document.write("<td>3</td>");
document.write("<td>	Utigord</td>");
document.write("<td>Norway</td>");
document.write("<td>2,625</td>");


document.write("<tr>");
document.write("<td>4.</td>");
document.write("<td>	Monge</td>");
document.write("<td>Marstein, Norway</td>");
document.write("<td>2,540</td>");


document.write("<tr>");
document.write("<td>5.</td>");
document.write("<td>	Gocta Cataracts</td>");
document.write("<td>Chachapoyas, Peru</td>");
document.write("<td>2,532</td>");


document.write("<tr>");
document.write("<td>6.</td>");
document.write("<td>	Mutarazi</td>");
document.write("<td>	Nyanga Natíl Park, Zimbabwe</td>");
document.write("<td>3,212</td>");



document.write("<tr>");
document.write("<td>7.</td>");
document.write("<td>yosemite</td>");
document.write("<td>Yosemite Natíl Park, California</td>");
document.write("<td>2,425</td>");



document.write("<tr>");
document.write("<td>8.</td>");
document.write("<td>espelands</td>");
document.write("<td>Hardanger Fjord, Norway</td>");
document.write("<td>2,307</td>");



document.write("<tr>");
document.write("<td>9.</td>");
document.write("<td>Lower Mar Valley</td>");
document.write("<td>Eikesdal, Norway</td>");
document.write("<td>2,151</td>");



document.write("<tr>");
document.write("<td>10.</td>");
document.write("<td>.	Tyssestrengene</td>");
document.write("<td>Odda, Norway</td>");
document.write("<td>2,123</td>");









</html>
</body>
</script>





























</html>
</body>



Is This A Good Question/Topic? 0
  • +

Replies To: document.write not working

#2 suxinjava  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 10-August 08

Re: document.write not working

Posted 09 March 2009 - 08:53 AM

Q: create a web page name highestwaterfalls.html that uses document.write() statements to print a table containing the names,locations and height of the highest waterfalls in the world.


me:
i still cant show the output.why?tell me why.. ;[

<html>

<body>


<script language="javascript">

documnt.write("<h1> 10 Highest Waterfall In The World</h1>");

document.write("<table border='1'> ");
document.write("<tr>");
document.write("<td>Number</td>");
document.write("<td>Name of waterfalls</td>");
document.write("<td>Location</td>");
document.write("<td>height(metre)</td>");




document.write("<tr>");
document.write("<td>1.</td>");
document.write("<td>	Angel</td>");
document.write("<td>Canaima Nat’l Park, Venezuela</td>");
document.write("<td>3,212</td>");




document.write("<tr>");
document.write("<td>2.</td>");
document.write("<td>		Tugela</td>");
document.write("<td>Natal Nat’l Park, South Africa</td>");
document.write("<td>3,110</td>");


document.write("<tr>");
document.write("<td>3</td>");
document.write("<td>	Utigord</td>");
document.write("<td>Norway</td>");
document.write("<td>2,625</td>");


document.write("<tr>");
document.write("<td>4.</td>");
document.write("<td>	Monge</td>");
document.write("<td>Marstein, Norway</td>");
document.write("<td>2,540</td>");


document.write("<tr>");
document.write("<td>5.</td>");
document.write("<td>	Gocta Cataracts</td>");
document.write("<td>Chachapoyas, Peru</td>");
document.write("<td>2,532</td>");


document.write("<tr>");
document.write("<td>6.</td>");
document.write("<td>	Mutarazi</td>");
document.write("<td>	Nyanga Nat’l Park, Zimbabwe</td>");
document.write("<td>3,212</td>");



document.write("<tr>");
document.write("<td>7.</td>");
document.write("<td>yosemite</td>");
document.write("<td>Yosemite Nat’l Park, California</td>");
document.write("<td>2,425</td>");



document.write("<tr>");
document.write("<td>8.</td>");
document.write("<td>espelands</td>");
document.write("<td>Hardanger Fjord, Norway</td>");
document.write("<td>2,307</td>");



document.write("<tr>");
document.write("<td>9.</td>");
document.write("<td>Lower Mar Valley</td>");
document.write("<td>Eikesdal, Norway</td>");
document.write("<td>2,151</td>");



document.write("<tr>");
document.write("<td>10.</td>");
document.write("<td>.	Tyssestrengene</td>");
document.write("<td>Odda, Norway</td>");
document.write("<td>2,123</td>");








</script>
</html>
</body>


Was This Post Helpful? 0
  • +
  • -

#3 Astano  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 27
  • Joined: 09-July 07

Re: document.write not working

Posted 09 March 2009 - 08:55 AM

I think it is because your last three tags are the wrong way around, you currently have:

</html>
</body>
</script>



You should have:
</script>
</body>
</html>



It worked for me when I changed these around.

Edit: Just realised you have </body> and </html> twice. Delete the first occurence of each and make sure the order is as above, ie close script then body then html, it should work.

This post has been edited by Astano: 09 March 2009 - 08:57 AM

Was This Post Helpful? 0
  • +
  • -

#4 suxinjava  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 10-August 08

Re: document.write not working

Posted 09 March 2009 - 09:01 AM

sir,it still cant work.
pffft
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: document.write not working

Posted 09 March 2009 - 09:13 AM

You had your first document.write() spelled wrong (you had documnt. Here is the modified code that worked for me

<html>
<head>
<script language="javascript">
document.write("<h1> 10 Highest Waterfall In The World</h1>");

document.write("<table border='1'> ");
document.write("<tr>");
document.write("<td>Number</td>");
document.write("<td>Name of waterfalls</td>");
document.write("<td>Location</td>");
document.write("<td>height(metre)</td>");




document.write("<tr>");
document.write("<td>1.</td>");
document.write("<td>	Angel</td>");
document.write("<td>Canaima Nat’l Park, Venezuela</td>");
document.write("<td>3,212</td>");




document.write("<tr>");
document.write("<td>2.</td>");
document.write("<td>		Tugela</td>");
document.write("<td>Natal Nat’l Park, South Africa</td>");
document.write("<td>3,110</td>");


document.write("<tr>");
document.write("<td>3</td>");
document.write("<td>	Utigord</td>");
document.write("<td>Norway</td>");
document.write("<td>2,625</td>");


document.write("<tr>");
document.write("<td>4.</td>");
document.write("<td>	Monge</td>");
document.write("<td>Marstein, Norway</td>");
document.write("<td>2,540</td>");


document.write("<tr>");
document.write("<td>5.</td>");
document.write("<td>	Gocta Cataracts</td>");
document.write("<td>Chachapoyas, Peru</td>");
document.write("<td>2,532</td>");


document.write("<tr>");
document.write("<td>6.</td>");
document.write("<td>	Mutarazi</td>");
document.write("<td>	Nyanga Nat’l Park, Zimbabwe</td>");
document.write("<td>3,212</td>");



document.write("<tr>");
document.write("<td>7.</td>");
document.write("<td>yosemite</td>");
document.write("<td>Yosemite Nat’l Park, California</td>");
document.write("<td>2,425</td>");



document.write("<tr>");
document.write("<td>8.</td>");
document.write("<td>espelands</td>");
document.write("<td>Hardanger Fjord, Norway</td>");
document.write("<td>2,307</td>");



document.write("<tr>");
document.write("<td>9.</td>");
document.write("<td>Lower Mar Valley</td>");
document.write("<td>Eikesdal, Norway</td>");
document.write("<td>2,151</td>");



document.write("<tr>");
document.write("<td>10.</td>");
document.write("<td>.	Tyssestrengene</td>");
document.write("<td>Odda, Norway</td>");
document.write("<td>2,123</td>");

</script>
</head>
<body>

</body>
</html>




Hope that helps :)

EDIT: Moved to Javascript forum :)
EDIT #2: Title changed to be more descriptive :)
Was This Post Helpful? 0
  • +
  • -

#6 suxinjava  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 10-August 08

Re: document.write not working

Posted 09 March 2009 - 09:17 AM

oh ok thanks everyone.
love you guys!
Was This Post Helpful? 0
  • +
  • -

#7 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: document.write not working

Posted 09 March 2009 - 09:19 AM

No problem, glad I could help :)

Now go forth my document.write guru and tell the world :)
Was This Post Helpful? 0
  • +
  • -

#8 richiebee  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 259
  • Joined: 27-November 08

Re: document.write not working

Posted 09 March 2009 - 10:03 AM

View PostPsychoCoder, on 9 Mar, 2009 - 08:19 AM, said:

No problem, glad I could help :)

Now go forth my document.write guru and tell the world :)

:D lol
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1