Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    how do i understand messages in the error console?

    What can I do to find out what the errors in the error console mean?

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by RintheSquid View Post
    What can I do to find out what the errors in the error console mean?
    One possible solution would be to post them here
    along with the problematic code.

  • #3
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Okay. So the error console says that "calendarDay" is not defined. This is for a class. I am doing a tutorial and following the book. I have everything exactly as it is in the book and there is a little date that is not showing up in the upper right hand corner of the web page.

    function calendar() {
    document.write("<table id='calendar_table'>");
    writeCalTitle(calDate);
    document.write("</table>");
    }

    function writeCalTitle (calendarDay) {
    var monthName = new Array ("January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December");

    var thisMonth=calendarDay.getMonth();
    var thisYear=calendarDay.getFullYear();

    document.write("<tr>");
    document.write("<th id='calendar_head' colspan='7'>");
    document.write(monthName[thisMonth]+" "+thisYear);
    document.write("</th>");
    document.write("</tr>");
    }

    There's the javascript. Let me know if you want to see my HTML. Also, it has changed the navBar on the webpage and the HTML formatting is not showing up.

  • #4
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts
    <head>
    <title>The Chamberlain Civic Center</title>
    <link href="ccc.css" rel="stylesheet" type="text/css" />

    <link href="calendar.css" rel="stylesheet" type="text/css" />
    <script src="cal.js" type="text/javascript"></script>
    </head>

    <body>
    <div id="head">
    <script type="text/javascript">
    calendar();
    </script>

    <img src="logo.gif" alt="Chamberlain Civic Center" />
    </div>

    <div id="links">
    <table><tr>
    <td><a href="#">Home</a></td><td><a href="#">Tickets</a></td>
    <td><a href="#">Events</a></td><td><a href="#">Tour</a></td>
    <td><a href="#">Directions</a></td><td><a href="#">Hours</a></td>
    <td><a href="#">Packages</a></td><td><a href="#">Contact Us</a></td>
    </tr></table>
    </div>

    There's some of the HTML. I will upload the page to my school server and post the URL if you would like also.

  • #5
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    Quote Originally Posted by RintheSquid View Post
    [COLOR="Teal"]Okay. So the error console says that "calendarDay" is not defined.
    Code:
    writeCalTitle(calDate);
    document.write("</table>");
    }
    
    function writeCalTitle (calendarDay) {
    You are calling writeCalTitle with the parameter calDate. Where is
    calDate defined?

  • Users who have thanked Logic Ali for this post:

    RintheSquid (02-15-2011)

  • #6
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry, I am still getting my head around the concepts here.

    So, both "calendarDay" and calDate" need to be defined as functions or as variables?
    As variables, right? Because that is the parameter for the function?

  • #7
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts
    function calendar() {
    var calDate = new Date("March 18, 2011");
    document.write("<table id='calendar_table'>");
    writeCalTitle(calDate);
    writeDayNames();
    writeCalDays(calDate);
    document.write("</table>");
    }

    function writeCalTitle (calendarDay) {
    var monthName = new Array ("January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December");

    var thisMonth=calendarDay.getMonth();
    var thisYear=calendarDay.getFullYear();

    document.write("<tr>");
    document.write("<th id='calendar_head' colspan='7'>");
    document.write(monthName[thisMonth]+" "+thisYear);
    document.write("</th>");
    document.write("</tr>");
    }

    When I view the page in firefox the formatting for the navigation buttons is gone...

  • #8
    New Coder
    Join Date
    Feb 2011
    Location
    eugene, oregon
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Still need help! Due today!

    title>The Chamberlain Civic Center</title>
    <link href="ccc.css" rel="stylesheet" type="text/css" />

    <link href="calendar.css" rel="stylesheet" type="text/css" />
    <script src="cal.js" type="text/javascript"></script>
    </head>

    <body>
    <div id="head">
    <script type="text/javascript">
    calendar();
    </script>

    <img src="logo.gif" alt="Chamberlain Civic Center" />
    </div>

    <div id="links">
    <table><tr>
    <td><a href="#">Home</a></td><td><a href="#">Tickets</a></td>
    <td><a href="#">Events</a></td><td><a href="#">Tour</a></td>
    <td><a href="#">Directions</a></td><td><a href="#">Hours</a></td>
    <td><a href="#">Packages</a></td><td><a href="#">Contact Us</a></td>
    </tr></table>
    </div>

    Here's some of the HTML.
    Last edited by RintheSquid; 02-15-2011 at 10:43 PM. Reason: wanted a new title to show up


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •