实体名称必须紧跟在'&'在实体引用中.javascript
the entity name must immediately follow the '&' in the entity reference. javascript
我正在尝试在我的Thymeleaf
页面中进行Ajax调用。这里是代码
<script>
function getTodayRequest(){
console.log("here is today");
var xhttp=new XMLHttpRequest();
xhttp.onreadystatechange=function(){
if(this.readyState==4 && this.status==200){
document.getElementById("received").innerHTML=
this.responseText;
}
};
xhttp.open("GET","URI",true);
}
</script>
因此出现了错误:
the entity name must immediately follow the '&' in the entity reference. java
和我已经改变了&
与&
,现在它看起来像:
if(this.readyState==4 && this.status==200)
但是现在它又抱怨了:
Uncaught SyntaxError: Unexpected token ;
第二个&
我该如何处理?
我有一个类似的问题,我已经解决了从thymelefeaf参考文档中添加scripting inling
。
javascript
代码放在<script th:inline="javascript">
之间,像下面:
<script th:inline="javascript">
/*<![CDATA[*/
function getTodayRequest(){
console.log("here is today");
var xhttp=new XMLHttpRequest();
xhttp.onreadystatechange=function(){
if(this.readyState==4 && this.status==200){
document.getElementById("received").innerHTML=
this.responseText;
}
};
xhttp.open("GET","URI",true);
}
/*]]>*/
</script>
相关文章:
- 引用对象中的通用值
- 如何在JavaScript中将字符串转换为函数引用
- 当包含另一个asp文件时,是否也包含所有引用的样式和脚本页面
- 在动态创建的元素上获取对特定选择器的引用
- IIFE中的函数引用不可用
- 如何通过引用var Using DataTables来进行分页或排序
- 如何在创建键时引用来自同一对象的键
- Datatables:通过DOM数据源中的名称引用列
- 自引用回调
- 引用类变量中的原型方法
- 无法获取属性'selectedIndex'的未定义引用或null引用
- breezejs:向实体类型添加引用约束
- "实体名称必须紧跟在'&'在实体引用中&”;
- 实体名称必须紧跟在'&'在实体引用中
- 在自定义上下文提供程序中删除带有引用的实体
- 实体名称必须紧跟在'&'在实体引用中.javascript
- FaceletsException:实体名必须紧跟在'&'在实体引用中
- 实体名称必须紧跟在'&'在实体引用中
- 在一个具有规范化状态的React / Redux应用中,如何以及在哪里解析对其他实体的引用
- 有没有办法通过OData v4中的一个PATCH请求来更新实体属性并添加对它的引用