The code looks right but does not work.

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Jul 2007
Posts: 30
Reputation: Mylena is an unknown quantity at this point 
Solved Threads: 1
Mylena Mylena is offline Offline
Light Poster

The code looks right but does not work.

 
0
  #1
Sep 5th, 2008
Hi,

In the code below, when I click on the link Colour, it needs to connect to javascript function and display "Hello" or alert message. For some reason, it does not do it.

If anyone spots a mistake, pleeese let me know - I'll be here.

Appreciate!

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6.  
  7. <script language="JavaScript" type="text/JavaScript">
  8. <!--
  9. function tabs() {
  10. alert('hhh');
  11. document.getElementById("contentAA").innerHtml="Hello";
  12. //-->
  13. </script>
  14.  
  15.  
  16. </head>
  17.  
  18. <body>
  19.  
  20. <a href="javascript:void(0);" onClick="tabs()">Colour</a>
  21.  
  22. <div id="contentA"><p id="contentAA"> </p></div>
  23. <div id="contentB"><p id="contentBB"> </p></div>
  24.  
  25. </body>
  26. </html>
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,403
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: The code looks right but does not work.

 
0
  #2
Sep 5th, 2008
You don't have the close brace } on the function
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 30
Reputation: Mylena is an unknown quantity at this point 
Solved Threads: 1
Mylena Mylena is offline Offline
Light Poster

Re: The code looks right but does not work.

 
0
  #3
Sep 5th, 2008
Thanks!!!!!!!!!!!!!!!!!!!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC