如何删除页面上的附加 html 对象

发布于 2024-12-03 03:37:48 字数 740 浏览 2 评论 0原文

由于一些非常困难的原因,我在页面开始之前、在我真正的 开始之前插入了额外的...。这来自另一个应用程序,我无法删除它。

所以代码看起来像这样:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://www.facebook.com/#!/nagradnaigra123.si?sk=app_163054567105477">here</a>.</h2>
</body></html>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
... normal content from here on...

所以我问我到底如何才能删除页面开头的附加头。我可以编辑 css,添加 javascript、jquery、php...但我只是不知道这个问题的解决方案。

这有可能吗?

for some very hard reason i get inserted additional ... before the beggining of my page, before my real <head> starts. This comes from another app i cant remove it.

So the code looks like this:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://www.facebook.com/#!/nagradnaigra123.si?sk=app_163054567105477">here</a>.</h2>
</body></html>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
... normal content from here on...

So im asking how on earth can i remove the additional head on the begginig of my page. i can edit css, add javascript, jquery, php... but i just dont know the solution to this problem.

Is this possible at all?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

已下线请稍等 2024-12-10 03:37:49

将身体标签从头部取出。

应该是

<head>
stuff
<title>Object moved</title>
</head>

<body>
stuff
<h2>Object moved to <a href="http://www.facebook.com/#!/nagradnaigra123.si?sk=app_163054567105477">here</a>.</h2>

</body>

Take the body tags out of the head.

Should be

<head>
stuff
<title>Object moved</title>
</head>

<body>
stuff
<h2>Object moved to <a href="http://www.facebook.com/#!/nagradnaigra123.si?sk=app_163054567105477">here</a>.</h2>

</body>
尘世孤行 2024-12-10 03:37:49

将下面的代码放入 中,删除第一个 </code> 和 <code><h2></code> 标记。这将使开头额外的 <code><html></code> 标记对您的页面没有任何影响。

<script type="text/javascript">
    var e = document.getElementsByTagName( 'title' );
    e[0].parentNode.removeChild( e[0] );
    e = document.getElementsByTagName( 'h2' );
    e[0].parentNode.removeChild( e[0] );
</script>

适用于 FireFox,未在其他浏览器中进行测试。

Remove the first <title> and <h2> tags by putting the code below in your <head>. This will make the extra <html> tag at the beginning have no effect on your page.

<script type="text/javascript">
    var e = document.getElementsByTagName( 'title' );
    e[0].parentNode.removeChild( e[0] );
    e = document.getElementsByTagName( 'h2' );
    e[0].parentNode.removeChild( e[0] );
</script>

Works in FireFox, didn't test in other browsers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文