gpt4 book ai didi

javascript - 为什么 getAttribute 返回 null?

转载 作者:行者123 更新时间:2023-11-28 07:55:42 25 4
gpt4 key购买 nike

我正在使用动态 CRM。我创建了一个 HTML Web 资源并添加到“联系人”表单。代码,

<html>
<head>
<title>OData</title>
<meta charset="utf-8">
</head>
<body>
<script type="text/javascript">
function getAllAttribute() {

document.getElementById("demo").innerHTML = Xrm.Page.getAttribute();
}
</script>
<button onclick="getAllAttribute();">Attributes!</button>
<p id="demo">Value will be displayed here</p>
</body>
</html>

现在,当我单击属性!按钮时,演示段落为空,为什么它没有给出页面上所有属性的名称?

最佳答案

可以使用window.parent.Xrm.Page.data.entity.attributeswindow.parent.Xrm.Page.getAttribute()代替 Xrm.Page.getAttribute();.

请参阅此处:http://msdn.microsoft.com/en-in/library/gg328474.aspx

关于javascript - 为什么 getAttribute 返回 null?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26113169/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com