Webサイトの特定の1つのページにのみ特定のパネルを表示し、残りのページには非表示にする、機能するJavaScriptコードが必要です。これはフォーラム風の設定です。
これが私がこれまでに得たものです。
<script type="text/javascript">
function ShowPanel()
{
if(document.location.href == "http://www.exampleurl.com")
{document.getElementById("panel").style.display = "block";}
else
{document.getElementById("panel").style.display = "none";}
}
</script>
<div id="panel" onload="ShowPanel">
Example text.
</div>
私が調べたサンプルコードによると、これはすべて合理的であるように見えますが、明らかにどこかにエラーがあります。何も起こりません。
チェックしてくれてありがとう!