2017-06-03 79 views
-1

對不起我的英語,我的另一個國籍未捕獲的ReferenceError:的WriteHTML沒有定義

我在JS代碼,但遺憾的是它並沒有因爲這個警告 如何修復它,使其工作工作,謝謝

你說得對,對不起,這裏是完整的代碼,我包括在亞歷克這個腳本3.1

這些受影響的文件

1) overall_footer_after.html

2) overall_header_page_body_before.html

3) scrollamp.js

1)在overall_footer_after.html和加載的scrollamp.js文件這樣

<!-- INCLUDEJS scrollamp.js --> 

2)這是我把文件中的代碼:overall_header_page_body_before.html

<div class="forabg"> 
    <div class="inner"> 
     <ul class="topiclist"> 
      <li class="header"><dl><dt>News</dt></dl></li> 
     </ul> 
      <div class="postbody" style="width: 100%">    
       <div class="post bg2"> 
<div class="avviso" style="padding: 0px; width: 400px; height: 200px; margin: 0 auto 0 auto;text-align:center; border: #00ffff 0px solid;"> 
<script type="text/javascript"> 
innerHTML() 
</script> 
</div> 
        </div> 
       </div> 
      </div> 
    </div> 

3)這是我把文件中的代碼scrollamp.js

function innerHTML() { 
document.write("<marquee width\"400\" height\"200\" direction=\"Up\" scrollamount=\"1\" scrolldelay=\"1\">"); 
document.write("<p style=\"font-size:25px;font-weight: bold;color:red;text-align:center;text-decoration:underline blink;\">.:| AVVISO IMPORTANTE |:.<\/p>"); 
// document.write("<br\/>"); 
document.write("<p style=\"font-size:15px;font-weight: bold;color:#000;text-align:center;\">Tutti gli Utenti Registrati, dovranno effettuare almeno 5 messaggi per visualizzare tutto il forum<\/p>"); 
document.write("<\/marquee>"); 
} 
+1

我們無法在任何地方看到您的.js文件。它具有調用的WriteHTML之前加載。你也可以使用innerHTML或者至少只有一個document.write – mplungjan

+0

@mplungjan https://developer.mozilla.org/en-US/docs/Glossary/Histing目錄 – j08691

+0

加載到另一個html文件,這樣<! - INCLUDEJS scrollamp.js - > –

回答

0

我想對我好,所以我會回答你的問題。 但是,請不要指望別人回答這樣一個模棱兩可的問題。
您沒有提供完整的HTML代碼,以便沒有人能夠給出任何實際給你的建議。

這是我懷疑你的問題可能是:

你的JavaScript文件是不錯,但你需要在使用前將其導入。

ReferenceError: writeHTML is not defined 

時,從字面上看,該對象還沒有被定義即沒有匯入它尚未這種錯誤纔會被拋出。

要導入一個腳本來完成:

<script src="fileName.js"></script> 

這就是所有我可以從您提供的信息告訴。

+0

您是對的,我編輯了第一條消息 –

+0

@giacobbecovatta確保您的scrollamp.js文件位於style/template/ – ed9w2in6

+0

JS文件位於styles \ prosilver \ template –

相關問題