我试图从html加载iframe函数,但我在该函数上得到一个未定义。我得到一个“未捕获的ReferenceError:iframeLoad未定义”。我错过了什么吗?
<html>
<head>
</head>
<body onload="iframeLoad()">
<iframe id="accountroles" width="350px" height="300px"></iframe>
<script type="text/javascript">
function iframeLoad(){
var recordID = window.parent.Xrm.Page.data.entity.getId().replace(‘{‘, ”).replace(‘}’, ”).toLowerCase();
var url = "https://web.powerapps.com/webplayer/iframeapp?hideNavBar=true&source=website&appId=/providers/Microsoft.PowerApps/apps/xxxx-xxxx-xxxx-xxxx-xxxxx&da&accountID="+ recordID;
document.getElementById("accountroles").src = url;
}
</script>
</body>
</html>
好吧,这可能是由于您的JS代码包含语法错误,如果浏览器无法正确解析代码,则该函数将无法随时使用。
replace(‘{‘, ”).replace(‘}’, ”)
- 那些“印刷”单引号是错误的,你需要用正确的引号替换它们,' -04FS