473,509 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change innerhtml with function gives black page?

Thew
69 New Member
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 1499
JKing
1,206 Recognized Expert Top Contributor
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,658 Recognized Expert Moderator Expert
<script type="text/javascript" src="content.js"/> only works in XHTML served as application/xhtml+xml
Oct 21 '10 #3

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

Similar topics

1
5501
by: Jurate | last post by:
Maybe somebody can suggest a way to invoke C# function from HTML page? -- Jurate
4
16374
by: dale zhang | last post by:
Hi, I have the following private function in one page: private string Connect() { string sConnect; // this value could go directly in the Global.asax.vb declarations switch...
2
2167
by: thamood | last post by:
hi guys i was just wondering can i call a function from another page and get the return value? like if i had page1.php which have the function fun1() can i call this function from another page ??...
1
1148
by: Warhorse | last post by:
We have recently been getting reports that when people go to our website The Stockholm Agency , that a black page loads and nothing more. The weird thing about this is, these people who are...
3
1854
by: viratkothari | last post by:
Public Function MaxValOfIntArray(ByRef TheArray As Variant) As Integer 'This function gives max value of int array without sorting an array Dim i As Integer Dim MaxIntegersIndex As Integer...
6
3531
by: subhash9 | last post by:
Hi, I want to change the title or my page without refreshing my HTML / JSP page. Is there any possible to do that using HTML / DHTML / javascript. Thanks in advance.. Regards,
4
2147
by: 42Olds | last post by:
I am trying to change an int on a page using JS - up if the right button is clicked, down if the left one. The code dose increment the value - and even places it in the holder currentThumb, but...
1
1691
by: jmohan | last post by:
Hi everyone, I am developing a website using asp.net with C#. And I developed a toolbar using javascript like google and yahoo toolbar which is placed in the browser separately. Toolbar has...
3
2251
by: bdog4 | last post by:
I have a master page that use <ul& <lito create tabs across the top. I need to be able to set the id="current" when user on corresponding pages. How can I do this from the content page? Thanks ...
6
6353
by: sangam56 | last post by:
Hi all, I want to add listener to a div element from .js file. All the controls are being created in the .js file and then loaded in the .aspx page. The problem is that I cannot use jquery or...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
441
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.