Solved

Page Error: 'console' is undefined

Posted on 2013-05-18
5
654 Views
Last Modified: 2013-10-07
I have constructed a very simple page index1.aspx with masterPage index1.master in Visual Studio 2008 with IIs express.
When displaying the page with internet explorer v8 I get the following errror:
No error is displayed using chrome browser.
Message: 'console' is undefined
Line: 200
Char: 3
Code: 0
URI: http://localhost:10225/sqlCams00DataCS/modules/create_cams_managers/index1.aspx
Thanks in advance for any help given.
For clarity I the full code is below:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="index1.master.cs" Inherits="modules_create_cams_managers_index1" %>
<!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 runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class modules_create_cams_managers_index1 : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
<%@ Page Language="C#" MasterPageFile="~/modules/create_cams_managers/index1.master" AutoEventWireup="true" CodeFile="index1.aspx.cs" Inherits="modules_create_cams_managers_index1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class modules_create_cams_managers_index1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}

Open in new window

0
Comment
Question by:homeshopper
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Ersoy Hasan
ID: 39177042
You are using console.log() somewhere in the javascript .I guess it is added for debugging. Search them and delete them you don need it for production.
0
 

Author Comment

by:homeshopper
ID: 39177175
Thank you for yor comment.
I could not find a console.log or code reference to console.log()
The pages are very simple without any javascript.
However, on another site I found the following:
<script type="text/javascript">
    if(typeof console === "undefined") { var console = { log: function (logMsg) { } }; }
</script>
Adding this code between
<head runat="server">
<title>Untitled Page</title>
 </head>
Cured the problem.
I assume there is some common problem when using IE8.
0
 
LVL 4

Accepted Solution

by:
Ersoy Hasan earned 500 total points
ID: 39180122
well that is not a problem console is something that belongs to debugging tools and it is not part of the browser. If you do not have javascript your page shouldn't fire javascript errors :). Look closely to your code. You can post the generated html from the browser if you'd like me to further investigate it :) .
0
 

Author Comment

by:homeshopper
ID: 39180218
Thanks, at this time I was only using html and using IeWebDeveloper V2 for ie8
to check page structure and tags etc. Later on in development will probably be using some java, but mostly C#.
0
 

Author Comment

by:homeshopper
ID: 39551623
I've requested that this question be closed as follows:

Accepted answer: 0 points for homeshopper's comment #a39180218

for the following reason:

I have now solved the problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hovering effect 9 46
File Upload Control on a ASP.NET Overlay Page 1 42
SQL Exceptions 3 37
Code works but it's slow 23 26
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now