So, Ive decided to do some tutorials and and work through Microsoft's Javascript Step by Step book. In doing so I have worked through this example and continue to get "Microsoft JScript runtime error: Object expected" I believe it's directing me to line 23 for the problem. My problem is that I do not know what the problem is. I'm assuming that I am missing something in regards to a setting in the IDE (VS 2010), which I am fairly new to. Not really sure...
Thanks in advance for help!
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="javascript._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--Validation using the W3C’s Markup Validator tool-->
<html>
<head>
<script type="text/javascript">
function cubeme(incomingNum){
if (incomingNum == 1)
{
return "What are you doing?"'
}else{
return Math.pow(incomingNum,3);
}
}
</script>
<title> A Chapter 3 Example</title>
</head>
<body>
<script type="text/javascript">
var theNum = 2;
var finalNum = cubeme(theNum);
if (isNaN(finalNum)) {
alert("You should know that 1 to the power is 1.");
} else {
alert("When cubed, " + theNum + " is " + finalNum);
}
</script>
</body>
</html>]
This post has been edited by jpconleyiv: 03 June 2011 - 08:47 AM

New Topic/Question
Reply



MultiQuote




|