无效的tumblr头,重复的doctype,奇怪的javascript [英] invalid tumblr head, duplicated doctype, strange javascript
问题描述
我的tumblr博客出了问题。在我的两个不同主题中有一些javascript和一个重复的doctype,我无法在自定义设置区域或主题标记设置中删除。
i got a problem with my tumblr blogs. There is some piece of javascript and a duplicated doctype in my two different themes, which i can't remove on the custom settings area or on the theme markup settings.
支持无法帮助。
这真的很糟糕:该页面无效,所以你不能在某些浏览器中访问它,特别是在Linux上。
The really bad thing on this: the page is damn invalid, so you can't visit it in some browser, especially on Linux.
错误的代码:
<!DOCTYPE html><script>!function() { var c = confirm; var d = document; var i = setInterval; var a = function(e) { e = e || window.event; var t = e.target || e.srcElement; if (t.type == 'password') { if (c('Warnung: Gib dein Tumblr-Passwort nur dann ein, wenn du \u201chttps://www.tumblr.com/login\u201d\x0ain der Adresszeile deines Browsers siehst.\x0a\x0aAu\u00dferdem sollte dort ein gr\u00fcnes \u201cTumblr, Inc.\u201d-Logo zu sehen sein.\x0a\x0aSpammer und andere Strolche benutzen gef\u00e4lschte Formulare, um an Passw\u00f6rter zu kommen.\x0a\x0aTumblr wird dich niemals bitten, dich vom Blog eines Users aus einzuloggen.\x0a\x0aWillst du ganz sicher fortfahren?')) { a = function() {}; } else { t.value = ""; return false; } } }; i(function() { if (typeof d.addEventListener != 'undefined') d.addEventListener('keypress', a, false)}, 0); }();</script><!DOCTYPE html>
推荐答案
所有 Tumblr博客都有这个问题。甚至官方Tumblr员工博客:
All Tumblr blogs have this problem. Even the official Tumblr staff blog:
<!DOCTYPE html>
<script>
!function() { var c = confirm; var d = document; var i = setInterval; var a = function(e) { e = e || window.event; var t = e.target || e.srcElement; if (t.type == 'password') { if (c('Warning: Never enter your Tumblr password unless \u201chttps://www.tumblr.com/login\u201d\x0ais the address in your web browser.\x0a\x0aYou should also see a green \u201cTumblr, Inc.\u201d identification in the address bar.\x0a\x0aSpammers and other bad guys use fake forms to steal passwords.\x0a\x0aTumblr will never ask you to log in from a user\u2019s blog.\x0a\x0aAre you absolutely sure you want to continue?')) { a = function() {}; } else { t.value = ""; return false; } } }; i(function() { if (typeof d.addEventListener != 'undefined') d.addEventListener('keypress', a, false)}, 0); }();
</script>
<!DOCTYPE html>
<!-- NOTE: This theme is used multiple places. Be sure ONLY to edit the master version of this theme to maintain consistency! -->
<html>
...
Tumblr似乎将此脚本注入所有博客页面,可能是为了防止/警告用户不要在博客所有者的控制下将密码输入密码字段。
Tumblr seems to inject this script into all blog pages, probably to prevent/warn users not to enter their password into password fields under the blog owner's control.
As Tumblr会自动注入DOCTYPE,您可以从自定义主题中删除DOCTYPE。尽管如此,注入的脚本
元素仍然是在开头的 html
元素之前,导致无效的标记。
As long as Tumblr injects a DOCTYPE automatically, you could remove the DOCTYPE from your custom theme. Nevertheless, the injected script
element will still be before the opening html
element, resulting in invalid markup.
这篇关于无效的tumblr头,重复的doctype,奇怪的javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!