2011-12-07 36 views
0
<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>The Goodies</title> 
    <link rel="stylesheet" href="core.css" type="text/css"/> 
    <meta name="generator" content="DocBook XSL Stylesheets V1.74.0"/> 
    <script type="text/javascript"> function changestyledisplayblock(id){ var ps = document.getElementsByTagName('p'); for (var i=0; i &lt; ps.length; i++) { if (ps[i].id == id) { if (ps[i].style.display == 'none') {ps[i].style.display = 'block';} else {ps[i].style.display = 'none';} } } } </script> 
</head> 
<body> 
    <div class="sect1" title="The Goodies"> 
     <div class="sect2" title="Multimedia"> 
      <div class="titlepage"> 
       <div> 
        <div> 
         <h2 class="title"> 
          <a id="multimedia">Multimedia</a> 
         </h2> 
        </div> 
       </div> 
      </div> 
      <p class="bubble speech" id="bubble-speech-0 " style="display:none;">*0 : My first one !</p> 
      <p class="bubble speech" id="bubble-speech-0 " style="display:none;">*0 : My second one !</p> 
      <p>text <a class="marker" href="javascript:changestyledisplayblock('bubble-speech-0 ')">*0 </a>next</p> 
     </div> 
    </div> 
</body> 
</html> 

這裏我的html,我有錯誤ReferenceError:無法找到變量changestyledisplayblock,我沒有看到任何錯誤,請幫助!如果我將我的html擴展更改爲xhtml,我不再看到問題了嗎?任何解釋?safari ReferenceError:找不到變量changestyledisplayblock

回答

1

'<'應該小於符號。或者是在粘貼代碼時出錯?

另外,我建議不要在定位標記中調用JavaScript代碼。

+0

<是的問題,thx :) –

+0

當然,沒問題。 –

相關問題