2012-06-05 25 views
0

我在一個頁面上有多個iframe項目(基於vb.net的應用程序),特別是,一個是保存生成詳細信息框架的鏈接的框架。目前JavaScript是爲IE工作,但在其他瀏覽器中使用時,它無法正常工作。下面是導致此錯誤頁面上的多個iframe - 只有IE正確更改其他框架

window.parent.detailFrame.location.href = form + "?cat=" + cat + "&par=" + par + "&HighlightID=" + HighlightID; 

我可以告訴大家這條線是不正確的Firefox,因爲這條線後,將在功能警報時,他們不火行,但他們在IE做。任何人都可以看到什麼需要做這個工作在Firefox和IE?謝謝。

編輯:

我能夠使用的項目,如 window.parent.getElementById( 'detailFrame')位置 或window.parent.getElementById( 'detailFrame')的href但不喜歡window.parent。 .getElementById('detailFrame')。location.href - 只使用.location或.href時,iframe不會刷新到新頁面。

回答

-1

我認爲,所有你需要做的是設置位置,沒有位置的href:

window.parent.detailFrame.location = form + "?cat=" + cat + "&par=" + par + "&HighlightID=" + HighlightID; 
+0

呃......沒有。改變位置是改變它的href的好辦法。 –

+0

@kolink是正確的,這是不成功的 – njj56

+0

我能夠使用像window.parent.getElementById('detailFrame')。location或window.parent.getElementById('detailFrame')。href但不喜歡window.parent。 getElementById('detailFrame')。location.href - 當使用.location或.href時,iframe不會刷新到新頁面。 – njj56

0

能夠使用的.src重做,不location.href

相關問題