我一直在尝试在网站上运行 Microstrategy 报告,并尝试了 html 和 js 方法。作为测试,我写了这个(下面的代码),但我不断收到错误并且报告没有出现在我的 iframe 中。我检查了 Chrome 中的检查器并不断收到此错误 -
拒绝在框架中显示“ https://www.microstrategy.com/us/free/express/analytics-express-sign-in?documentID=D3F9920011E43A6B000000802FC73DA5&OrgId=30650#sign-in ”,因为它设置了“X-Frame-Options” '到'同源'。
这是我的代码:
<html>
<body>
<SCRIPT>
function run() {
var sel = document.getElementById('sel');
var idx = sel.selectedIndex;
switch (idx) {
case 0:
document.getElementById('test').style.visibility = "visible";
document.getElementById('test').contentWindow.location.href="https://cloud11.microstrategy.com/MicroStrategy/servlet/mstrWeb?pg=shareAgent&apptype=2&documentID=D3F9920011E43A6B000000802FC73DA5&OrgId=30650&RRUid=1872948";
break;
case 1:
document.getElementById('test').style.visibility = "visible";
document.getElementById('test').contentWindow.location.href="https://cloud11.microstrategy.com/MicroStrategy/servlet/mstrWeb?pg=shareAgent&apptype=2&documentID=D3F9920011E43A6B000000802FC73DA5&OrgId=30650&RRUid=1872948";
break;
default:
document.getElementById('test').style.visibility = "hidden";
}
function hide() {
document.getElementById('test').style.visibility = "hidden";
}
}
</SCRIPT>
<iframe id="test" src="about:blank" width="800" height="500" style="visibility:hidden;">
</iframe>
<br>
<select id="sel">
<option>Report1</option>
<option>Report2</option>
</select>
<br>
<br>
<input type="button" value="Run" onclick="run();"/>
<input type="button" value="Close" onclick="hide();"/>
</body>
</html>
收到该错误后,我决定在 URL 中添加“./”,但只是将其视为错误:
GET file:///C:/wamp/www/ADLScorm/ https://cloud11.microstrategy.com/MicroStrateg …pe=2&documentID=D3F9920011E43A6B000000802FC73DA5&OrgId=30650&RRUid=1872948 net::ERR_FILE_NOT_FOUND
请问我该如何解决这个问题?
PS(我最初也使用了 document.getElementById('test').src 。仍然得到同样的错误)