(X)HTML, JavaScript, DHTML, XML, CSS Client scripting tehnologije, Dynamic HTML, Cascading Stylesheets, XML i standardi |
|
Alati teme | Način prikaza |
|
27. 04. 2006. | #1 |
Ivan Dilber
Sir Write-a-Lot
|
javascript, iframe i Opera
Iframe se generise iz skripte, i ja pokupim referencu na njega, ali koliko vidim (u Operi 8.5) iframe nema ni contentDocument, ni contentWindow, ni document property. Kako da onda pristupim sadrzaju iframe-a ?
EDIT: Da bude malo jasnije o cemu pricam, evo primer: Kôd:
var ifrm = document.createElement("iframe"); ifrm.id = "test"; window.document.body.appendChild(ifrm); var obj = document.getElementById('test'); if (obj.contentDocument) { // For NS6 alert('obj.contentDocument'); } else if(obj.contentWindow) { // For IE5.5 and IE6 alert('obj.contentWindow.document'); } else if(obj.document) {// For IE5 alert('obj.document'); } else { alert ('nema'); }
__________________
Leadership is the art of getting people to want to do what you know must be done. Poslednja izmena od ivanhoe : 27. 04. 2006. u 16:56. |
27. 04. 2006. | #2 |
banned
Professional
Datum učlanjenja: 04.06.2005
Poruke: 371
Hvala: 0
738 "Hvala" u 83 poruka
|
Koristi contentDocument, ima u specifikaciji, samo je potrebno sačekati da se učita:
Kôd:
var ifrm = document.createElement("iframe"); ifrm.id = "test"; window.document.body.appendChild(ifrm); ifrm.onload = function() { var obj = document.getElementById('test'); if (obj.contentDocument) { // For NS6 alert('obj.contentDocument'); } else if(obj.contentWindow) { // For IE5.5 and IE6 alert('obj.contentWindow.document'); } else if(obj.document) {// For IE5 alert('obj.document'); } else { alert ('nema'); } }
__________________
Don't look at me; I'm lost too. “If you can't dazzle them with brilliance, baffle them with bul*s**t.” |
28. 04. 2006. | #3 |
Ivan Dilber
Sir Write-a-Lot
|
aha, to je dakle, mora da se ucita...skroz sam zaboravio na to
__________________
Leadership is the art of getting people to want to do what you know must be done. |
|
|
Slične teme | ||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
iframe i linkovanje piratskih sadrzaja? | trazimcuruzabrak | Istine i zablude | 23 | 02. 09. 2010. 12:28 |
[JS] HTML kod IFRAME-a | Nemanja Avramović | Sva početnička pitanja | 6 | 14. 03. 2008. 20:50 |
Hackovanje i <iframe> | Djuki | Web Hosting, web serveri i operativni sistemi | 16 | 03. 07. 2007. 18:59 |
Iframe i JS | ivanhoe | (X)HTML, JavaScript, DHTML, XML, CSS | 5 | 19. 12. 2006. 22:45 |
Javascript razlika u IE, FF, Opera | misk0 | (X)HTML, JavaScript, DHTML, XML, CSS | 8 | 03. 03. 2006. 18:17 |