leora
leora

Reputation: 196499

In IE8, why am I getting a javascript error on my DocType line

I am getting this error when running a webpage in internet explorer 8 (not sure if it matters but it happens when I load up a jquery ui dialog)

enter image description here

When I click yes, it brings up the IE8 javascript debugging tools but what is weird is that it shows the error being on the doctype line . .

enter image description here

Can anyone explain what IE is trying to tell me and how I can debug this??

Update:

in response to folks saying i need to remove the blank line at the top, here is my code. There is no extra blank line on anything in my site.master file so i don't understand what it would take to remove this blank line that i see when i view source in IE8.

<%@ Import Namespace="DomainModel" %>
<%@ Import Namespace="Mvc.Views.OrganisationalUnit" %> 
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<Mvc.ViewModels.BaseViewModel>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

Upvotes: 0

Views: 1095

Answers (1)

Dolan Antenucci
Dolan Antenucci

Reputation: 15942

Try removing the whitespace at the top of the file (i.e. line 1). If that doesn't help, try retyping the string manually to make sure no odd characters are hidden in there. Otherwise, the code looks valid to me.

Update:
Try removing the line breaks between your import statements like this:

<%@ Import Namespace="DomainModel" %><%@ Import Namespace="Mvc.Views.OrganisationalUnit" %><%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<Mvc.ViewModels.BaseViewModel>" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

Upvotes: 1

Related Questions