Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove an unknown-named pop up?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have been designated the responsibility to design a website for my high school's band. For some reason, the sysadmin who designed the main page for the school added a hidden serverside script to all subsidiary pages on the server, and it adds a pop up for my school district..I'm relatively new to JS, (vb is my forte), and I need help getting rid of the pop up...

here is what I have in the head in the <script type=&quot;Javascript> tag

function closeWindow() {
If (top.window != self.window) {

otherWindow = top.window
otherWindow.close() }
}
then in my body tag is <body onBlur=&quot;closeWindow()&quot;>

It doesn't work...obviously...suggestions?
 
Unless you've got a reference to the window, you cannot close it.
I.E.

var newWindow
function openWin()
{
newWindow = window.open(&quot;blah&quot;, &quot;blah&quot;, &quot;blah&quot;);
}

newWindow is your reference and unless you know what that is in your environment you cannot close it newWindow.close();
 
you can try:

x=window.open(&quot;&quot;)
if(!x.closed)
{
x.close()
}

soemtimes it grabs whatever window was previously opened. I've seen it work, but I'm not sure if it always will. jared@eae.net -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top