繁体   English   中英

使用html,JavaScript发布的文件,未在本地加载

[英]Files published using html, JavaScript, not loading locally

我们有一系列与Lectora共同开发并在线发布的电子学习课程。 不幸的是,Lectora源文件丢失。 我们所拥有的只是索引文件,附带的.js文件和支持文档文件。

当通过网络执行index.html文件时,课程将加载就绪,但是将它们复制到本地计算机时,这些课程将加载。 没有错误。 窗口仅显示“正在加载,请稍候”。

我可以更改.html或.js文件中的内容以启用本地加载吗?

INDEX.HTML文件的代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<!--GENERATED BY:  Lectora Professional Publishing Suite v.9.3(6345) (http://www.trivantis.com) -->


<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Bear Aware</title>

<script language = "JavaScript" src="trivantis.js"></script>
<script language = "JavaScript" src="trivantis-cookie.js"></script>
<script language = "JavaScript">

<!-- 
if( is.ieMac )
  document.write( '<font size=4>(Note: Internet Explorer for the Macintosh does not support JavaScript access to applets/AJAX. This is a browser limitation, not a shortcoming of the course material. For this reason, Macintosh IE 5 users cannot access course materials incorporating JavaScript/AJAX functions. Please try accessing this course material from a non-Macintosh machine or a non-IE browser on the Macintosh.</font><br /><br />' )
else if( !is.min )
  document.write( 'Your browser does not support dynamic html. Please download a current version of either <a href="http://www.microsoft.com/ie/">Microsoft Internet Explorer</a> or <a href="http://www.mozilla.com/en-US/firefox/">Mozilla Firefox </a> and try visiting our site again.  Thank You.<br /><br />' )

var winW = screen.width
var winH = screen.height

function findWH() {
    winW = (is.ns)? window.innerWidth-16 : document.body.offsetWidth-20
    winH = (is.ns)? window.innerHeight   : document.body.offsetHeight
}

function ReFlow() {
}

onload = init

function init() {
  findWH()
}
// -->

</script>
</head>

<frameset rows="0,*" border="0" frameborder="0" framespacing="0"  onResize="ReFlow()">
  <frame name="titlemgrframe" src="titlemgr.html" resize="no" scrolling='no' marginwidth='0' marginheight='0' />
  <frame name="contentframe" src="content.html" resize="no" />
  <noframes>
    <body>
      <p>Your browser does not support frames</p>
    </body>
  </noframes>
</frameset>
</html>

JS文件的代码

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Bear Aware</title>

<script language = "JavaScript" src="trivantis.js"></script>
<script language = "JavaScript" src="trivantis-cookie.js"></script>
<script language = "JavaScript">

<!-- 
if( is.ieMac )
  document.write( '<font size=4>(Note: Internet Explorer for the Macintosh does not support JavaScript access to applets/AJAX. This is a browser limitation, not a shortcoming of the course material. For this reason, Macintosh IE 5 users cannot access course materials incorporating JavaScript/AJAX functions. Please try accessing this course material from a non-Macintosh machine or a non-IE browser on the Macintosh.</font><br /><br />' )
else if( !is.min )
  document.write( 'Your browser does not support dynamic html. Please download a current version of either <a href="http://www.microsoft.com/ie/">Microsoft Internet Explorer</a> or <a href="http://www.mozilla.com/en-US/firefox/">Mozilla Firefox </a> and try visiting our site again.  Thank You.<br /><br />' )

var winW = screen.width
var winH = screen.height

function findWH() {
    winW = (is.ns)? window.innerWidth-16 : document.body.offsetWidth-20
    winH = (is.ns)? window.innerHeight   : document.body.offsetHeight
}

function ReFlow() {
}

onload = init

function init() {
  findWH()
}
// -->

</script>
</head>

<frameset rows="0,*" border="0" frameborder="0" framespacing="0"  onResize="ReFlow()">
  <frame name="titlemgrframe" src="titlemgr.html" resize="no" scrolling='no' marginwidth='0' marginheight='0' />
  <frame name="contentframe" src="content.html" resize="no" />
  <noframes>
    <body>
      <p>Your browser does not support frames</p>
    </body>
  </noframes>
</frameset>
</html>

这可能很难完全回答,因为可能有很多事情。 浏览器拒绝加载本地内容非常常见,因为它可能是恶意的。

首先,我要指出的是,您发布的两个代码示例实际上是相同的,并且是HTML和JavaScript的混合,它们也不完整。 HTML引用了您尚未发布的另外两个库trivantis.jstrivantis-cookie.js

假设您确实以绝对正确的结构将所有正确的文件保存在本地...

...我将通过使用The Web of Mark来告诉IE忘记它的安全性问题并无论如何加载本地内容。

因此,您的HTML将如下所示(请注意第二行):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0016)http://localhost -->
<html>
<!--GENERATED BY:  Lectora Professional Publishing Suite v.9.3(6345) (http://www.trivantis.com) -->

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Bear Aware</title>

失败的话,还有其他一些事情可能会有所帮助:

  • IE>工具> Internet选项>高级>安全>选中“允许活动内容在我的电脑上的文件中运行”
  • localhost添加到您的受信任的站点
  • 禁用IE的所有插件

希望这些作品之一。 祝好运!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM