我對theme_tests.html得到一個錯誤提供syntaxhighlighter_3.0.83,這是我以前未得到頁。 錯誤是DOCTYPE不允許在內容處<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
裏面第一個腳本標記<script id="sample" type="text/plain">
標記中。syntaxhighlighter_3.0.83:theme_tests.html(A DOCTYPE是不是在內容不允許)
這裏是頁theme_tests.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SyntaxHighlighter Theme Tests</title>
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
</head>
<body>
<div id="output"></div>
<style>
body {
background: white;
font-family: Helvetica;
}
.test-wrap {
width: 100%;
height: 800px;
overflow: auto;
border: none;
}
</style>
<script id="sample" type="text/plain">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SyntaxHighlighter Theme Tests</title>
</head>
<body>
<script>
/**
* Looks for a child or parent node which has specified classname.
* Equivalent to jQuery's $(container).find(".className")
* @param {Element} target Target element.
* @param {String} search Class name or node name to look for.
* @param {Boolean} reverse If set to true, will go up the node tree instead of down.
* @return {Element} Returns found child or parent element on null.
*/
function findElement(target, search, reverse /* optional */)
{
if (target == null)
return null;
var nodes = reverse != true ? target.childNodes : [ target.parentNode ],
propertyToFind = { '#' : 'id', '.' : 'className' }[search.substr(0, 1)] || 'nodeName',
expectedValue,
found
;
// main return of the found node
if ((target[propertyToFind] || '').indexOf(expectedValue) != -1)
return target;
return found;
};
</script>
</body>
</html>
</script>
<script type="text/javascript">
var themes = [
['#fff', 'Default'],
['#000', 'Django'],
['#fff', 'Eclipse'],
['#000', 'Emacs'],
['#000', 'FadeToGrey'],
['#000', 'MDUltra'],
['#000', 'Midnight'],
['#000', 'RDark']
];
$(document).ready(function()
{
var sample = $('#sample').text().replace(/</g, '<');
$.each(themes, function(index)
{
var $iframe = $('<iframe class="test-wrap" src="about:blank" />'),
background = this[0],
themeName = this[1]
;
$('#output')
.append(''
+ '<h1>'
+ '<a href="#theme' + (index + 1) + '">next</a> '
+ '<a name="theme' + index + '">'
+ themeName
+ '</a>'
+ '</h1>'
)
.append($iframe)
;
$iframe.ready(function()
{
var doc = $iframe[0].contentDocument;
$iframe.css('background', background);
doc.write(''
+ '<scr' + 'ipt type="text/javascript" src="/sh/scripts/XRegExp.js"></scr' + 'ipt>'
+ '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shCore.js"></scr' + 'ipt>'
+ '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shBrushXml.js"></scr' + 'ipt>'
+ '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shBrushJScript.js"></scr' + 'ipt>'
+ '<link type="text/css" rel="stylesheet" href="/sh/styles/shCore' + themeName + '.css"/>'
+ '<pre type="syntaxhighlighter" class="brush: js; html-script: true; highlight: [5, 20]" title="This is SyntaxHighlighter theme ' + themeName + ' in action!">'
+ sample
+ '</pre>'
+ '<pre type="syntaxhighlighter" class="brush: js; html-script: true; collapse: true">'
+ sample
+ '</pre>'
+ '<scr' + 'ipt type="text/javascript">'
+ 'SyntaxHighlighter.highlight();'
+ '</scr' + 'ipt>'
);
doc.close();
});
});
$('#output a[name]:first').attr('name', 'top');
$('#output a[href]:last').attr('href', '#top').html('top');
});
</script>
</body>
</html>
的網頁頁面我在我的Java Web應用程序是好的呈現在Chrome,但不是在Firefox 4 我記得在同一頁之前,我的應用程序曾用於在兩個瀏覽器上正常工作。
不僅改變了我把我的系統自從我看到我的應用程序呈現在同一頁面恰當定位:
我加jquerywtp1.10插件我的Eclipse IDE 3.5。
更新了firefox到firefox 4版本。
有人可以幫我理解我應該怎麼做才能在mozilla firefox 4上正確顯示相同的網頁?
這是我得到的錯誤,上線29號:http://programatori.evonet.ro/images/1308360109285/doctype.jpg
theme_tests.html是可以在中找到:https://bitbucket.org/alexg/syntaxhighlighter/src/a8771a7fc81d/tests/theme_tests.html
可能有人開導我要怎麼做掉這個錯誤?
感謝您的回覆,我在我的應用程序獲得的問題是因事很無聊的我在做什麼。它與DOCTYPE無關。我所知道的關於DOCTYPE的一點是,如果是HTML,它會告訴你在文檔中使用的HTML類型,並且它告訴你關於XML結構的限制。非常感謝回覆:)。 – skip