There are some errors on my website that only occur with certain images that are inside the tag <img>
. Actually, the error only happens with the Mozilla Firefox browser , with the others (Chrome, Opera, Edge) it doesn't happen to me. The images load fine in Firefox , but the problem is that I right-click on the page ( "Inspect element" option ) to check the console and there I see some errors ( warnings ) and which says the following verbatim:
"XML parsing error: tag without pair. Expected: </img>
."
I don't know why "XML parsing" (I don't have anything structured in that language). Then, below, it puts the location, which is where the image is. I have the image enclosed with a div:
<div style="text-indent:0px;text-align:center;margin:0.7em 0 1em 0"><img data-src="GloImg/Menu.png" class="lazyload" alt=""></div>
As far as I know, the tag <img>
does not have a closure (I have also noticed it on the w3schools page ). Although in some places and looking for my error they say to put the closing slash at the end: <img data-src="GloImg/Menu.png" class="lazyload" alt="" />
, but this closing is not necessary in HTML5 , it may be in XML .
As I said before, the strange thing is that the other browsers don't give me an error when I go to inspect the console. Is it something unimportant? The version of Firefox I have is 78.02 .
I have already solved. After a good review of the code, the problem was in a .js file that makes use of AJAX and specifically with the overrideMimeType() method .
There it was
overrideMimeType("text/xml")
and I changed it tooverrideMimeType("text/plain")
. Now it doesn't give me that error in Firefox, and in the other browsers it works too.good day.
From what I can understand the problem is that it only gives you a warning regarding the closure of tags
<img scr="myurl" alt="ejemplo" >
... Ideally, you should follow the complete syntax, so that you do not get the warning.I link you a response from the user Einer in which he explains it in a little more detail, I hope it will be useful to you.
Link to respect