简体   繁体   中英

Files published using html, JavaScript, not loading locally

We have a series of eLearning courses that were developed with Lectora and published for web. Unfortunately, the Lectora source files are lost. All we have are the index file, attendant .js files, and supporting documentation files.

The courses load ready when the index.html files are executed over the network, but not when they are copied to a local machine. 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?

CODE FOR INDEX.HTML FILE

<!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

<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. The HTML references two other libraries which you have not posted called trivantis.js and trivantis-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.

So your HTML would look like this (notice the second line):

<!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
  • Add localhost to your Trusted Sites
  • Disable any addons your have for IE

Hopefully one of these works. Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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