What does Firebug "XML cannot be the whole program" error message mean?
Asked Answered
C

7

10

I just got this error message in Firebug. A google search reveals nothing but other mystified people! Does anyone have any idea what it means?

It's being indicated on the last line of this 3-line script:

<script>
    g_BuildServer = "/";
</script>
Conal answered 3/9, 2009 at 2:43 Comment(0)
O
12

If you put JavaScript in a js file (which I assume you did), do NOT put the script tags, put

g_BuildServer = "/";

only.

Otherwise, to the parser, you just provided an XML document as a script.

Outgo answered 16/9, 2009 at 15:48 Comment(0)
A
6

I got this error when using jquery $get with no data type attribute when it was retrieving html. I added the dataType parameter as "html" and it fixed the issue.

Alow answered 27/4, 2010 at 3:57 Comment(1)
+1 Works! I had a DataType declared, but mine was script. Once I changed it to html, the error went away.Pointblank
D
2

Happened to me too, just for having an empty script tag in the page. When I removed this:

<script src="" type="text/javascript"></script>

everything got back to normal..

Deictic answered 8/4, 2010 at 7:34 Comment(0)
E
1

I got the "XML cannot be the whole program" error because the server was returning an xml error message in response to a request for a javascript file. My case may be unusual, but here it is:

I had a servlet filter granting or denying access to server resources. If it grants access, you get the resource, otherwise, you get <filterResponse><Access_Denied/></filterResponse>. I had failed to add the javascript file to the list of resources you don't have to be logged in to access. So, when Firefox received an XML error message as the body of a javascript program, its complaint makes perfect sense.

Espinoza answered 13/4, 2010 at 13:37 Comment(0)
S
0

I experienced this error when I had a comment in my javascript but it didn't start with a /* it just had a few *'s hence creating a syntax error

Smalto answered 17/8, 2010 at 4:39 Comment(0)
P
0

Also you can get this error while you use jQuery. In that case replace "$" with "jQuery"

Philo answered 2/9, 2010 at 9:6 Comment(0)
M
0

It also happens, when you use jQuery's template plugin, and you place the markup in a script tag, but you forget to change the script tag's type attribute to 'text/x-jquery-tmpl'

Minicam answered 13/2, 2012 at 12:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.