1

i have some javascript files included in my html file for months. It used to work just fine until couple of days ago, now my scripts don't run anymore and i get javascript error "invalid XML attribute value <script language=JavaScript>\n" with firebug.

Does anyone know what this error means and how to get rid of it? i guess is something about that newline "\n" but i can't see that in my file if i open it.

1
  • now it's <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "w3.org/TR/html4/strict.dtd"> Commented Apr 16, 2010 at 14:13

3 Answers 3

3

IIRC, language was never part of any specification, at least not in XHTML (And I think not in HTML, either.)

Try whether <script type="text/javascript"> works better.

Sign up to request clarification or add additional context in comments.

8 Comments

ok...now my line looks like this <script src="javascript/jquery.imageoverlay.js" type="text/javascript"></script>, and curiously i get same error ...
It used to be!, was deprecated in HTML 4: w3.org/TR/REC-html40/interact/scripts.html
@Nick Cheers for the info! @kmunky strange. Can you run your page(s) through a validator?
omg...i can't get it work! @Pekka i've read that article, i have changed the doctype,i've included my scripts just like there....and...still same problem..
@kmunky can you post the HTML before and after the script part please?
|
1

Try to find that <script language=JavaScript> and replace with

<script language="JavaScript">

or

<script type="text/javascript">

Comments

0

The error is because of missing quotes on language=JavaScript, but as the other answers say, it's best to replace it with type="text/javascript" (including the quotes!)

Make sure to always put your attributes in quotes, in this case you would have gotten another validation error even after doing so, but in itself is still a validation error, more importantly, it's a validation error with very real side-effects in many cases.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.