簡體   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