我也做了以下內容:動態插入到樣式IFRAME
<iframe id="portal" src="page-on-my-domain.php"></iframe>
$(document).ready(function() {
$('#portal').load(function(){
$('#portal').contents().find('head').append('<link href="/css/iframe.css" rel="stylesheet" type="text/css" />');
});
});
這是工作正常,但問題是,每當我更新的樣式表,不被在IFRAME應用更新的款式。我嘗試重新加載頁面和iframe,但它仍然在拾取舊的樣式。
什麼iframe?您必須向我們展示更多您的標記。 – 2012-02-08 11:14:14
是否調用了'load'處理程序? (檢查,在裏面放一個警報)。 – RoToRa 2012-02-08 12:49:37