Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Parsing Error: no root element found Location in Console FF

Tags:

I'm use ASP.NET MVC end I take this error only in FF. Why I take this error message? What is the cause of this? I don't understand where the source of this error. Anyone have any thoughts?

enter image description here

Next Error: enter image description here

like image 933
Paweł Groński Avatar asked Sep 29 '17 10:09

Paweł Groński


People also ask

What causes XML parsing error?

The most common cause is encoding errors. There are several basic approaches to solving this: escaping problematic characters ( < becomes &lt; , & becomes &amp; , etc.), escaping entire blocks of text with CDATA sections, or putting an encoding declaration at the start of the feed.

How do I fix XML parsing error in Firefox?

You can do a clean reinstall and remove the Firefox program folder to ensure that all files are replaced. You may have to disable security software temporarily in case the problem persists. You can create a new profile as a quick test to see if your current profile is causing the problem.


Video Answer


2 Answers

Check this link for more information

Based on my research, the error message is only generated by FireFox when the render page is blank in Internet. For some reason, .NET generates a response type of "application/xml" when it creates an empty page. Firefox parses the file as XML and finding no root element, spits out the error message.

in other words, this is a known Firefox issue

like image 103
Master Yoda Avatar answered Sep 21 '22 00:09

Master Yoda


I changed the type of return value in Action method and it worked. More details can be found in my article on this topic.

Changed from

return Ok();

to

return Json("Ok");
like image 41
Ovini Avatar answered Sep 23 '22 00:09

Ovini