简体   繁体   English

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

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

We have a series of eLearning courses that were developed with Lectora and published for web. 我们有一系列与Lectora共同开发并在线发布的电子学习课程。 Unfortunately, the Lectora source files are lost. 不幸的是,Lectora源文件丢失。 All we have are the index file, attendant .js files, and supporting documentation files. 我们所拥有的只是索引文件,附带的.js文件和支持文档文件。

The courses load ready when the index.html files are executed over the network, but not when they are copied to a local machine. 当通过网络执行index.html文件时,课程将加载就绪,但是将它们复制到本地计算机时,这些课程将加载。 There is no error. 没有错误。 The window simply says "Loading , please wait". 窗口仅显示“正在加载,请稍候”。

Is there something I can change in the .html or .js files to enable local loading? 我可以更改.html或.js文件中的内容以启用本地加载吗?

CODE FOR INDEX.HTML FILE 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>

CODE FOR JS FILE 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>

This is a hard one to fully answer since it could be a lot of things. 这可能很难完全回答,因为可能有很多事情。 It's very common for browsers to refuse to load local content as it can be malicious. 浏览器拒绝加载本地内容非常常见,因为它可能是恶意的。

For a start I would point out that the two code samples you have posted are practically identical and are a mix of HTML and JavaScript, they're also incomplete. 首先,我要指出的是,您发布的两个代码示例实际上是相同的,并且是HTML和JavaScript的混合,它们也不完整。 The HTML references two other libraries which you have not posted called trivantis.js and trivantis-cookie.js . HTML引用了您尚未发布的另外两个库trivantis.jstrivantis-cookie.js

Assuming that you really do have all of the right files in absolutely the correct structure saved locally... 假设您确实以绝对正确的结构将所有正确的文件保存在本地...

...I'll take a punt on using The Mark of the Web to tell IE to forget it's security concerns and load local content anyway. ...我将通过使用The Web of Mark来告诉IE忘记它的安全性问题并无论如何加载本地内容。

So your HTML would look like this (notice the second line): 因此,您的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>

Failing this there are a few other things that might help: 失败的话,还有其他一些事情可能会有所帮助:

  • IE > Tools > Internet Options > Advanced > Security > place a check in Allow active content to run in files on My Computer IE>工具> Internet选项>高级>安全>选中“允许活动内容在我的电脑上的文件中运行”
  • Add localhost to your Trusted Sites localhost添加到您的受信任的站点
  • Disable any addons your have for IE 禁用IE的所有插件

Hopefully one of these works. 希望这些作品之一。 Good luck! 祝好运!

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

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