我試圖讓這個頁面在Windows中正確顯示在Firefox 5的SVG內容:得到一個HTML頁面SVG在Ubuntu的工作在Windows中正確顯示在Firefox 5
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<title>SVG Rich Text Editor</title>
<style type="text/css">
...
</style>
<script>
var gui //define a global varaible to pass it on between frames
</script>
</head>
<body>
<iframe id="toolbar" src ="toolbar.html" width="500px" height="50px" frameBorder="0"></iframe><br/>
<iframe id="editor" src="editor.svg" width="500px" height="500px" frameBorder="0"></iframe>
</body>
</html>
它的工作原理在Ubuntu中完美,但在Windows(Vista)中加載頁面時Firefox 5問我是否打開或下載文件而不是顯示文件。
我也嘗試過使用對象標籤而不是iframe標籤。它再一次在Ubuntu中完美運行,但是在Windows中,它想要下載一個插件,我不介意,除非找不到任何插件。
我檢查過並且HTML5解析器在這個版本中自動啓用,所以不能這樣做。
有誰知道如何讓這個工作?
編輯3:
改變我的本地服務器,打印頭而不是做默認得到我得到這個加載後http://localhost:8000/editor.svg時:
Host: localhost:8000
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:6.0) Gecko/20100101 Firefox/6.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
這是在editor.svg
頂部<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
小記:編輯器裏面有一些java腳本和css。
EDIT 4
我創建基於Python的文檔(http://docs.python.org/library/httplib.html#examples)中提供的一個小的Python程序,並要求editor.svg 獲得響應頭:
'date': 'Sat, 20 Aug 2011 13:30:57 GMT'
'last-modified': 'Thu, 18 Aug 2011 11:34:42 GMT'
'content-length': '1986'</br>
'content-type': 'application/octet-stream'
'server': 'SimpleHTTP/0.6 Python/2.7.2'
我相信我們現在已經證實它將svg視爲應用程序,而不是圖像。問題是你如何解決這個問題?最好通過在svg本身中添加一些信息而不是搞亂服務器。
檢查與.svg一起發送的MIME類型。你是如何託管它?本地文件系統? Web服務器在本地主機上運行? – tdammers
你可以單獨顯示圖像(即只需在地址欄中輸入其網址)? –
@henning:非常好的評論我檢查時做http:// localhost:8000/editor.html它想要下載它,當輸入完整的路徑它的工作 – Danny