travisbrown
Technical User
- Dec 31, 2001
- 1,016
I'm refreshing an object in a parent window when closing a popup. I thought i could just use self.close(), but it messes stuff up.
FF js console gives me "http is not defined" on this line in the second function: if ( http.readyState == 4 ) {
Refreshes properly when I take self.close out. Any hints?
FF js console gives me "http is not defined" on this line in the second function: if ( http.readyState == 4 ) {
Refreshes properly when I take self.close out. Any hints?
Code:
<a href="javascript:sndParentReq('call_index.asp?key=<% = LEFT(song_title,1) %>','songlist');self.close();" ><img src="_images/exit.gif" class="savebutton" /></a>
var http = createRequestObject();
function sndReq(page,insert) {
http.open( 'get', page );
http.onreadystatechange = function(){
if ( http.readyState == 4 ) {
var response = http.responseText;
document.getElementById(insert).innerHTML = response;
}
};
http.send(null);
}
function sndParentReq(page,insert) {
http.open( 'get', page );
http.onreadystatechange = function(){
if ( http.readyState == 4 ) {
var response = http.responseText;
opener.document.getElementById(insert).innerHTML = response;
}
};
http.send(null);
}