469,950 Members | 2,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Change innerhtml with function gives black page?

Thew
69
Expand|Select|Wrap|Line Numbers
  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=utf-8" />
  5. <title></title>
  6. <link href="style.css" rel="stylesheet" type="text/css" />
  7. <script type="text/javascript" src="content.js"/>
  8. </head>
  9. <body>
  10. <div id="container">
  11.     <div id="header">
  12.         Download Center - AlphenWeer.nl
  13.     </div>
  14.     <div id="menu">
  15.         <a href="#" class="menu" onclick="contenthome();">Home</a> - 
  16.         <a href="#" class="menu" onclick="contentawoframe();">AWO Frame!</a> - 
  17.         <a href="#" class="menu" onclick="contenttoolbar();">Toolbar</a> -
  18.         <a href="#" class="menu" onclick="contentgadgets();">Vista / 7</a> 
  19.     </div>
  20.     <div class="content">
  21.         <p id="pinner">
  22.             Content
  23.         </p>
  24.     </div>
  25.     <div id="container1">
  26.         <div id="footer">
  27.             <br/>
  28.             <br/>
  29.             &copy; <a href="http://www.alphenweer.nl/">AlphenWeer.nl</a>
  30.         </div>
  31.     </div>
  32. </body>
  33. </html>
  34.  
Expand|Select|Wrap|Line Numbers
  1. var home = 'Welkom op de home pagina';
  2. var awoframe = 'Pagina AlphenWeerOnline Frame';
  3. var toolbar = 'Pagina toolbar';
  4. var gadgets = 'Pagina Gadgets';
  5.  
  6. function contenthome(){
  7.     document.getElementById('pinner').innerHTML = home;
  8. }
  9. function contentawoframe(){
  10.     document.getElementById('pinner').innerHTML = awoframe;
  11. }
  12. function contenttoolbar(){
  13.     document.getElementById('pinner').innerHTML = toolbar;
  14. }
  15. function contentgadgets(){
  16.     document.getElementById('pinner').innerHTML = gadgets;
  17. }
  18.  
  19.  
  20.  
This works in Firefox and Chrome but not in IE! What did i do wrong? Help! In IE i get a black page, and the content doesnt change!
Oct 20 '10 #1
2 1355
JKing
1,206 Expert 1GB
Line 7:
<script type="text/javascript" src="content.js"/>

Should be:
<script type="text/javascript" src="content.js"></script>
Oct 20 '10 #2
Dormilich
8,652 Expert Mod 8TB
<script type="text/javascript" src="content.js"/> only works in XHTML served as application/xhtml+xml
Oct 21 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jurate | last post: by
4 posts views Thread by dale zhang | last post: by
2 posts views Thread by thamood | last post: by
1 post views Thread by Warhorse | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.