Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
IE7 struggling with the simplest of scripts!
Old 02-04-2009, 09:45 AM IE7 struggling with the simplest of scripts!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
It doesn't pop up with an error message, it's just that the table just doesn't appear

Code:
function tableBuild ()
    {
        var container = document.getElementById ('container');
        
        // build head
        var headName = document.createTextNode ('Name');
        var headAge = document.createTextNode ('Age');
        var th1 = document.createElement ('th');
        var th2 = document.createElement ('th');
        var tr = document.createElement ('tr');
        var table = document.createElement ('table');
        
        // append
        th1.appendChild (headName);
        tr.appendChild (th1);
        table.appendChild (tr);
        container.appendChild (table);
        alert (table.nodeName);       
    }
    
window.onload = tableBuild;
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="ajaxStudent.js"></script>
</head>

<div id="container">
This is the container
</div>



<body>
</body>
</html>

It works okay in FF (surprisingly). Also, when I alert the nodeName, even IE recgnises it as a table, so I don't know why it isn't displaying it?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by pealo86; 02-04-2009 at 09:49 AM..
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 02-04-2009, 10:01 AM Re: IE7 struggling with the simplest of scripts!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Ahh never mind it appears to be a HTML error...
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 02-04-2009, 10:02 AM Re: IE7 struggling with the simplest of scripts!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
wait... no it's not!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 02-05-2009, 12:22 PM Re: IE7 struggling with the simplest of scripts!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
*SOLVED*

Incase anyone has ever had the same problem, I needed to include a 'tbody' inside the 'table' to get it working in IE
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to IE7 struggling with the simplest of scripts!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31027 seconds with 12 queries