how to assigning values for child window?
var selwindo开发者_JAVA百科w = window.open('child1.html','_blank','resizable=yes,width='+(screen.width-500)+',height='+(screen.height-500)+'');
selwindow.document.selectform.childText.value=document.getElementById('pdetails1').value;
I am using this code to assign a value for textbox in the child window. It works well in Internet Explorer, but it shows an error when run in Firefox. It shows: selwindow.document.selectform is undefined
.
Here, childText
is the current window textbox id, and pdetails1
is the child window text box id
I'm assuming that selectform is the name/id of something in the page.
IE doesn't actually use JavaScript, it uses jScript. jScript converts all names/ids into global variables, so that code works, but it won't work in anything other than IE.
Try:
selwindow.document.getElementById('selectform').childText.value = ...
if the form doesn't have an id, give it one:
<form id="selectform" />
精彩评论