I have a very simple html page with java script embedded to create an object and display some properties of the object. But it appears to be failing when I instantiate the new object. I confirmed that by removing the line where I am instantiating it and re-running the page with some alert messages. If I remove the line starting with var log…., the alert(“test”) display fine, else it does not display
<!DOCTYPE html>
<head>
<title>YouCube – The Blog for Cube Puzzlers</title>
<script = “text/javascript”>
function Blog(body, date) {
this.body = text;
this.date = date;
}
var blog = [ new Blog(“Got the new cube I ordered”, “08/10/2012”) ];
alert(“test”);
numEntries = blog.length;
alert(numEntries);
function showBlog(numEntries)
{
numEntries = blog.length;
alert(numEntries);
if (!numEntries)
{
numEntries = blog.length;
alert(numEntries);
}
}
</script>
</head>
<body>
<h2>YouCube – The Blog for Cube Puzzlers</h2>
<img src = “cube.png” alt = “YouCube” />
<div id=”blog”></div>
<input type = “button” id = “showall” value = “Show all Blog Entries” onclick = “showBlog()” />
</body>
<?html>
Any ideas/thoughts on what I could be doing wrong?
Thanks