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

时间:2015-06-29 19:34:52

标签: javascript html

我们有一系列电子学习课程,这些课程是用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>

1 个答案:

答案 0 :(得分:0)

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

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

假设您确实在绝对中确实拥有所有正确的文件,那么本地保存的正确结构......

...我会利用The Mark of the Web来告诉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&gt;工具&gt;互联网选项&gt;高级&gt;安全&gt;选中允许活动内容在“我的电脑”上的文件中运行
  • localhost添加到您的可信站点
  • 禁用您对IE的任何插件

希望其中一个有效。祝你好运!