简体   繁体   English

错误的img标签未在Internet Explorer中显示图像

[英]Faulty img tag not displaying images in Internet Explorer

One of our WordPress themes produces a strange tag due to some poorly written code. 由于某些代码编写得不好,我们的WordPress主题之一产生了一个奇怪的标记。 The tag is read fine by Chrome and Edge but Internet Explorer refuses to display the images. Chrome和Edge可以很好地读取该标签,但Internet Explorer拒绝显示图像。

This is how the tag is outputted in both Chrome and Internet Explorer. 这是在Chrome和Internet Explorer中输出标签的方式。

<img src="&lt;img width=" 806"="" height="605" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" srcset="https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin.jpg 806w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-152x114.jpg 152w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-768x576.jpg 768w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-253x190.jpg 253w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-506x380.jpg 506w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-600x450.jpg 600w, https://www.prikkabelled.nl/wp-content/uploads/Feestverlichting-voor-in-de-achtertuin-200x150.jpg 200w" sizes="(max-width: 806px) 100vw, 806px">

Is there some kind of frontend script or code that I can apply so that Internet Explorer will show the images? 我可以应用某种前端脚本或代码来使Internet Explorer显示图像吗?

I can delete the src attribute using $('.class').removeAttr('src') but this doesn't seem to fix the problem. 我可以使用$('.class').removeAttr('src')删除src属性,但这似乎无法解决问题。

For your viewing conveniece, I have included the url: https://www.staging1.prikkabelled.nl/referenties/ 为了方便您观看,我在其中添加了网址: https : //www.staging1.prikkabelled.nl/referenties/

try the following: 尝试以下方法:

  1. delete the src attribute, ie : src="<img width=" 删除src属性,即: src =“ <img width =”

  2. delete the 806"="" 删除806“ =”“

I think the above 2 should solve your problem. 我认为上述2应该可以解决您的问题。

In fact, your problem is not about the img tag itself, but what is before your img tag. 实际上,您的问题不是关于img标签本身,而是在img标签之前。

In chrome, I have inspected the source page, and I found this: 在chrome中,我检查了源页面,发现了这一点:

<img src="<img width="430" height="397" ...

I think you should watch source generated in your WYSIWYG editor or directly in your template 我认为您应该观看在所见即所得编辑器中或直接在模板中生成的源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM