Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more...

Saturday, April 11, 2009

Accessing Iframes

function loadyahoo(){
//alert(window.frames['myFrame']);
window.document.frames['myFrame'].location = "test1.html";
alert(window.frames['myFrame'].document.all.nametxt.value);
window.frames['myFrame'].document.getElementById('nametxt').value="Jeetu is great!";
/*var iframeEl = document.getElementById('myFrame');
if ( iframeEl.contentDocument ) { // DOM
var form = iframeEl.contentDocument.getElementById('nametxt');
} else if ( iframeEl.contentWindow ) { // IE win
var form = iframeEl.contentWindow.document.getElementById('nametxt');
}*/
//form.value="jeetu alex";
//window.document.getElementById('myFrame').src = "test1.html";
//alert(document.getElementById('myFrame').contentWindow.document.getElementById('nametxt'));
//document.getElementById('myFrame').contentWindow.document.getElementById('nametxt').value="Jeetu";
}

0 comments :

Post a Comment