weaveoftheride
weaveoftheride

Reputation: 4395

doctype syntax error

Do you see any problem with this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I'm in ASP.net and I'm using pikachoose jquery slideshow. It works fine in IE and was working in Firefox. However, somehow it's now stopped working in firefox and firebug is giving the doctype line above out as a syntax error and

$ is not defined for the jquery script?


if i work out exactly what happened I'll post my code and the problem, but I'm rolling back to an older version to fix it and will work from there.

Upvotes: 2

Views: 4899

Answers (8)

jerjer
jerjer

Reputation: 8760

Please check for unclosed tags.

Upvotes: 0

doug
doug

Reputation: 2111

In my case, i was getting this issue because my JavaScript files were in a folder that was not accessible when forms authentication was turned on. If you think this is the issue, you can add the following lines to your web.config:

  <location path="OpenScript">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

Where OpenScript is the directory of the script files you want to make accessible outside of forms authentication.

Upvotes: 0

Mahmut C
Mahmut C

Reputation: 433

This error occurs when the src javascript file is not loaded etc. I handle the error by putting / in the front of the src like:

<script src="/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>

Upvotes: 0

WizardsOfWor
WizardsOfWor

Reputation: 3134

That syntax error on DOCTYPE in firefox happens when you have a bad javascript inclusion in your page.

<script type="text/javascript" src="not_really_there.js"></script> 

when the src either does not exist, or isn't javascript.

The message isn't exactly helpful, but checking through your script tag src values will resolve it.

Upvotes: 6

reach4thelasers
reach4thelasers

Reputation: 26899

Change your <HTML> tag to:

<html xmlns="http://www.w3.org/1999/xhtml">

Upvotes: 0

kasp3r
kasp3r

Reputation: 308

Use http://validator.w3.org/ to validate your code. If you get errors, then fix them and it may help

Upvotes: 0

GlenCrawford
GlenCrawford

Reputation: 3389

Following on from Sarfraz's answer, you'll need to make sure that you have included the jQuery library before you include the "pikachoose" script.

somehow it's now stopped working in firefox

Did you change anything significant before you noticed that it stopped working?

Upvotes: 0

Sarfraz
Sarfraz

Reputation: 382616

In most cases, you get the error:

$ is not defined

when you have not included the jquery library in your page. Make sure that you have included it. Also check to make sure that you have not used the noConflict() method there.

Upvotes: 1

Related Questions