Solved

Page Error: 'console' is undefined

Posted on 2013-05-18
5
646 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

7 Experts available now in Live!

Get 1:1 Help Now