这不是我的专业领域所以,基本上我正在尝试测试这个基于Flash播放器的网络应用程序,我们的合作伙伴发送的文件非常适合从文件浏览器或在VS'17中进行调试。
以下是launcher.htm的HTML代码,但是当我尝试将其放入带有VS'17的Azure Web App时,所有文件和文件夹都已部署好,但是当我启动相同的文件时,它完全是空白的。
据我所知,它唯一的iframe的 src 子句存在一些问题,因为它获取'$ document.ready with JavaScript 的属性。当它在本地运行时有src,当没有从Azure src运行时。
可能是某种触发器阻止在Web服务器上发布,或者可能是我无法处理的一些愚蠢的事情,我的JS专长3/10
非常感谢!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="scripts/launch_wrapper.js" type="text/javascript"></script>
<script src="scripts/helper.js" type="text/javascript"></script>
<script type="text/javascript">
var settingInfo; //NavexGlobal change, storing settings.xml information.
var cbt_data = new Object;
function removeTags(str,tag){
var re= new RegExp('<'+tag+'[^><]*>|<.'+tag+'[^><]*>','g')
var text =str.replace(re,'');
return text;
}
function updatePageTitle(pageTitle)
{
document.title = removeTags(pageTitle,'font');
}
//NavexGlobal change, handling config.js to load completion.
function handleConfigScriptAdded()
{
setDefaults();
setTitle();
cbt_data.rubrics = settingInfo.rubrics;
cbt_data.mcp_swf = settingInfo.mcp_swf;
cbt_data.video_base = settingInfo.video_base;
cbt_data.version = versionInfo;
if(settingInfo.mobileEnabled != undefined)
{
cbt_data.mobileEnabled = settingInfo.mobileEnabled;
}
cbt_data.tc_config_xml = settingInfo.tc_config_xml;
cbt_data.document = document; //reuired for updating the title with pageid for QA
var url = "launch-mobile.html"+location.search; //launch url
document.getElementById("ifrm").src = url;
//
if(!checkFlashVersionSuppot() && cbt_data.mobileEnabled != undefined && String(cbt_data.mobileEnabled).toLowerCase() == "true")
{
$(window).bind('orientationchange', function() {
if ( orientation == 0 ) {
orientation = "Portrait";
}
else if ( orientation == 90 ) {
orientation = "Landscape";
}
else if ( orientation == -90 ) {
orientation = "Landscape";
}
else if ( orientation == 180 ) {
orientation = "Portrait";
}
if(document.getElementById("ifrm").contentWindow.updateOrientation != undefined)
{
document.getElementById("ifrm").contentWindow.updateOrientation(orientation);
}
});
document.getElementById("ifrm").src = "launch-mobile.html"+location.search;
//document.getElementById("ifrm").src = "html5/launch-mobile.html"+location.search;
}
else
{
var url = "launch.htm"+location.search; //launch url
document.getElementById("ifrm").src = url;
}
var url = "launch_elt.htm"+location.search; //launch url
document.getElementById("ifrm").src = url;
}
//NavexGlobal change for loading config.js files dynamically.
function launch(settingData)
{
settingInfo = settingData;
addScriptTag(settingInfo.configPath, handleConfigScriptAdded); //adding script tag for config.js
}
//NavexGlobal change for setting title of the html file.
function setTitle()
{
if(settingInfo.courseTitle != null)
{
cbt_data.courseTitle = unescape(unescape(settingInfo.courseTitle));
}
// $(document)[0].title = cbt_data.courseTitle+" v"+settingInfo.navpanelVersion;
$(document)[0].title = 'NAVEX Global'; // change by aneesh
}
//NavexGlobal change for loading setting.xml containing mcp wrapper details.
$(document).ready(function(){
init();
alert('hola papi');
});
// for checking flash support
function checkContentType()
{
var strPath ;
if(checkFlashVersionSuppot())
{
strPath="launch_elt.htm"+location.search; //launch url
//alert("go with Flash version");
}
else
{
strPath="launch-mobile.html"+location.search; //launch url
//strPath="html5/launch-mobile.html"+location.search; //launch url
}
return strPath;
}
function checkFlashVersionSuppot()
{
var hasFlash = true;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
//alert("status @1 "+ hasFlash )
}catch(e){
//if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
//alert("status @2 "+ hasFlash );
try
{
if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
{
//return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
hasFlash = true;
}
}
catch(e)
{
hasFlash = false;
}
}
alert("status @44 "+ navigator.mimeTypes ["application/x-shockwave-flash"] );
return hasFlash;
}
function supports_canvas()
{
//alert(!!document.createElement('canvas').getContext);
return !!document.createElement('canvas').getContext;
}
</script>
</head>
<body>
<iframe id="ifrm" name="ifrm_wrapper" frameborder="0" style="position:absolute; top:0px; left:0px;" width="100%" height="100%" scrolling="No"></iframe>
</body>
</html>
答案 0 :(得分:0)
好的,所以我发现Azure Web App没有设置所有mime类型,默认情况下,所有带json扩展名的jquery文件都被阻止,所以你必须在web的StaticContent子句中注册这个mime类型。配置并添加
<mimeMap fileExtension=".json" mimeType="application/json" />