Eclipse中jsp页面中js脚本报错this inspection checks that the script tag content is valid XML.

首先,js代码没有错误,在里面使用了el表达式,但是编辑器总是提示this inspection checks that the script tag content is valid XML,解决办法如下:

  1. 关闭js校验,这个就不用多说了,Preference中关闭即可。
  2. 修改页面的文档类型,由<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    修改为<!DOCTYPE html>,代码就不会再提示错误了。

猜你喜欢

转载自blog.csdn.net/Lemostic/article/details/79206620