PDA

View Full Version : why I can't get iframe's src?help!



hahaEr2003
14 Jul 2007, 6:14 AM
I make a layout useing EXT.It like the EXT's index.html docuement.
the left is a tree,when click the tree,the right (center panel)will be change.
the code like this:

...
var page = window.location.href.split('#')[1];
if(!page){
page = 'welcome.html';
}
this.loadDoc(page);

....

so,when I click left tree ,the center panel's location changed ,but ,when I get this document like this:

alert(Ext.get('center2').dom.src);

this will show welcom.html also,but isn't the new html page's url!

why?and how to get the changed document url?

Nullity
17 Jul 2007, 1:05 PM
When you create the iframe, be sure to give it an id. Then do one of the following (either will work):


document.getElementById('iframe_id').src = 'somefile.html';
// or
Ext.get('iframe_id').dom.src = 'somefile.html';