2011-01-14 85 views
0

我需要在一個文件中一個特定的詞進行搜索使用搜索上<object data>

<object data = "".....> 

,我已經嵌入我怎麼能引用

<object data> 

就像

<iframes>... 

    window.frames['iframe id']; 

回答

1

使用getElementsByTagName?我的快速測試:

<object data="http://www.google.com"></object> 
<object data="2"></object> 

和:

<script> 
var el = document.getElementsByTagName('object'); 

console.log(el[0].data); // http://www.google.com 
console.log(el[1].data); // http://localhost/2 
</script> 
+0

@Kuttu:我敢肯定你不能訪問的內容(至少不是這樣)。你在嵌入什麼'文件'? – labue 2011-01-14 16:54:04