未捕获的ReferenceError:未定义iframeLoad

问题描述 投票:1回答:1

我试图从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>
javascript html iframe microsoft-dynamics
1个回答
0
投票

好吧,这可能是由于您的JS代码包含语法错误,如果浏览器无法正确解析代码,则该函数将无法随时使用。

replace(‘{‘, ”).replace(‘}’, ”) - 那些“印刷”单引号是错误的,你需要用正确的引号替换它们,' -04FS

© www.soinside.com 2019 - 2024. All rights reserved.