0
var selwindow = window.open('child1.html','_blank','resizable=yes,width='+(screen.width-500)+',height='+(screen.height-500)+'');
selwindow.document.selectform.childText.value=document.getElementById('pdetails1').value;
我正在使用此代碼爲子窗口中的文本框分配一個值。它在Internet Explorer中運行良好,但在Firefox中運行時顯示錯誤。它顯示:selwindow.document.selectform is undefined
。如何爲子窗口分配值?
這裏,childText
是當前窗口的文本框的ID,並pdetails1
是子窗口的文本框的ID
我試過,但它顯示selwindow.document.getElementById( 'selectform')爲空 – Prabakaran 2011-03-22 04:22:18
表單標記是什麼樣的?我猜'selectform'是它的名字,在這種情況下你需要設置一個id。 – 2011-03-22 04:38:45
不,我改變了