【问题标题】:Random <hr/> that I don't know how to get rid of!我不知道如何摆脱的随机<hr/>!
【发布时间】:2011-03-03 02:42:01
【问题描述】:

我刚刚搜索文档找到它,我删除了&lt;hr class="cmdbar"&gt;&lt;/hr&gt;,但它仍然存在!你们还有其他人看到吗?


<?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<font face="Segoe UI">
<body>

<script type="text/javascript">
/*function detectBrowser()
{
    var browser = navigator.appCodeName;
    if (browser!="Mozilla") {document.location.href="noaccess.php"; alert(browser);}
}
detectBrowser();
*/
</script>

<title>Second</title>

<link rel="stylesheet" type="text/css" href="allCSS.css"/>
<center>
<!--<img align="right" src="logo.png" id="headerimg"/>-->

<input type="image" id="headerimg" src="logo.png" align="right" onclick="toggleh();"/>
<ul align="center" class="">

<div class="menu">
<ul class="nav">
<li><strong><a href="index.php">Home</a></strong>
<ul>
<li><a href="games.php">Games</a></li>
<li><a href="browse.php">Browse</a></li>
<li><a href="catalogue.php">Catalogue</a></li>
<li><a href="forum.php">Forums</a></li>
</ul>
</li>

<li><strong><a href="games">Games</a></strong>
<ul>
<li><a href="profile.php">Profile</a></li>
<li><a href="settings.php">Settings</a></li>
</ul>
</li>

<li><strong><a href="contact">Contact</a></strong>
<ul>
<li><a href="contact/index.php">Phone</a></li>
<li><a href="contact/index.php">Email</a></li>
<li><a href="contact/index.php">Mail</a></li>
</ul>
</li>
</div>

</center>
</body>
<center>
<?php
echo '<div id="msg">';
include 'message.txt';
echo '</div>';
//include 'hits.txt';
?>
<p>

<?php
function ChangeText($txt)
{
$txt='<script type="text/javascript">get();</script>';
echo '<script type="text/javascript">change();</script>';
$filename="message.txt";
$fp=fopen($filename,'w');
fwrite($fp,'<h4 class="hmsg">' . $txt . '</h4>');
fclose($fp);
}
?>
<script type="text/javascript">
<!--
window.onload=enter;

function enter()
{
    //alert("Welcome!");
    //hideCMD();
}

function get(text)
{
text=document.getElementById("ta").value;
return text;
}

function toggleh()
{
    var element=document.getElementById("headerimg");
    if (element.style.display!="none"){element.style.display="none";}
    else {element.style.display="";}
}

function change(text)
{
    text=document.getElementById("ta").value;

    if (text=="toggle") {toggleh(); return;}

    if (text=="home") {document.location.href="index.html"; return;}

    if (text.match("goto:*")) {var loc=text.substring(5,text.length); document.location.href=loc; return;}

    if (text.match("ban:*")) {var loc=text.substring(4,text.length); document.location.href=loc; return;}

    document.getElementById("msg").innerHTML='<h2 class="hmsg">'+text+'</h2>';
}

function hideCMD()
{
    document.getElementById("cmd").style.display="none";
}
//-->
</script>

</head>
<body>
<div id="msg">
</div>
<p id="cmd">
<input class="panela" type="text" value="" id="ta" maxLength="20"/>
<input class="panelb" type="image" src="submit.png" alt="Submit" onclick='change();'/>
</p>


</center>
<p class="hide">-</p>
</font>
</html>

【问题讨论】:

  • 我将您的代码粘贴到我自己的文件中并尝试...它不再存在。你试过Ctrl+F5强制刷新吗?或者,在最坏的情况下,重新启动您的 XAMPP 服务器?
  • 我会尝试重启XAMPP,如果不行,你有TeamViewer吗?
  • 在网页浏览器中右键单击页面,选择查看源代码并在&lt;hr上按Ctrl+F。
  • @BalusC 没找到。

标签: php javascript html xampp


【解决方案1】:

这里是&lt;hr class="cmdbar"&gt;&lt;/hr&gt;,第 126 行。CTRL + F 通常适用于大多数文本编辑器。

【讨论】:

    【解决方案2】:

    这里是:

    <p id="cmd">
    <hr class="cmdbar"></hr>
    <input class="panela" type="text" value="" id="ta" maxLength="20"/>
    <input class="panelb" type="image" src="submit.png" alt="Submit" onclick='change();'/>
    </p>
    

    浏览器也将 &lt;hr&gt;&lt;/hr&gt; 视为正确的 &lt;hr /&gt;,尽管根据 W3C 规范不应该如此。

    【讨论】:

      【解决方案3】:

      您也可以在 Firefox 中使用 Firebug。这是一个简洁的插件,可帮助您根据网页的外观查找代码。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-10-25
        • 2022-01-01
        • 1970-01-01
        • 2015-02-27
        • 2019-03-17
        • 2016-02-07
        • 2021-05-16
        • 2015-09-28
        相关资源
        最近更新 更多