2011-01-10 58 views
3

HTML5支持seamless IFRAME,這是一種包含HTML頁眉和頁腳的方法。我在Android(2.2)瀏覽器上試過這個,我認爲它應該是基於HTML5的,但它不起作用。有沒有辦法在Android上做HTML文件?是否有能力在Android瀏覽器中顯示無縫IFRAMES?

我試過的樣本是由index.html,header.html和footer.html組成的。在index.html的,它有:

<!DOCTYPE HTML> 
<iframe seamless="seamless" src="header.html" sandbox="allow-top-navigation allow-scripts allow-forms allow-same-origin"></iframe> 

My content goes here 

<iframe seamless="seamless" src="footer.html" sandbox="allow-top-navigation allow-scripts allow-forms allow-same-origin"></iframe> 

在header.html中,它有:

<html> 
<head> 
<link rel="stylesheet" href="android.css" type="text/css" /> 
<title>Test App</title> 
</head> 
<body> 
<div class="home page"> 
    <h1>Test App</h1> 
    <div class="home content"> 

在footer.html,它有:

</div><!-- .home .content --> 
    <div class="home footer"> 
    </div><!-- .home .footer --> 
</div><!-- .home .page --> 
</body> 
</html> 

但是,當我跑了在運行Android 2.2的三星Galaxy Tab上的代碼,我有兩個不是無縫的IFRAMES,並且頁面呈現就像在HTML4.01中一樣。

回答