OT: What in IE can prevent Javascript from opening new window?

O

ohaya

Hi,

This is a little off-topic, because I'm really trying to find out why my
IE6 is messed up.

I started noticing that my IE6 seems to be working (or not working)
strangely today.

One thing is that when I got to a website that and click on something
(e.g., a link or button) that normally opens a new window, nothing happens.

Finally, when I try to go to Windows Update, I get to the page where
it's asking to install a new installer, I click "Install Now", and then
get a page that says "Windows Update is downloading and installing the
updated software", then it just sits there (i.e., the new Windows Update
software doesn't seem to get loaded).

I've run Ad-aware, and it didn't find anything. I also have Symantec
Antivirus, and it's not found anything.

I think that I was able to reproduce the problem, using a small HTML
page with Javascript for opening a new window:

=================================
<HTML>
<HEAD>
<Script Language="JavaScript">
<!-- Script courtesy of http://www.web-source.net - Your Guide to
Professional Web Site Design and Development
function load() {
var load =
window.open('http://www.yahoo.com','','scrollbar...zable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>


</HEAD>
<BODY>
<a href="javascript:load()">Open Window</a>
</BODY>
</HTML>
=================================

When I access the above HTML page using my IE6, then click on the "Open
window" link, nothing happens.

I've also tried to access the above HTML page using my IE6, then click
on the "Open window" link, and I get a new window with the Yahoo page.

If I access the above HTML page using (for example) Netscape 7, then
click on the "Open window" link, I get a new window with the Yahoo page.

So, I'm concluding that something happened to the IE6 on my main machine
that is preventing the Javascript from opening a new window.

Any ideas what might be happening and how to fix this?

Thanks,
Jim
 
H

Hubert


I cannot reproduce your problem, but maybe the following helps.

(1) Load the given url manually and watch for any error messages.
Maybe the browser is attempting to enter the debugger or something.

(2) Use '_blank' as the second argument, or some random string like
'test' + Number( Date() ).
This makes sure that the new window really has an acceptable name.

Good luck,
Hubert
 
S

SAM

Le 12/12/08 1:45 AM, ohaya a écrit :
Hi,

This is a little off-topic, because I'm really trying to find out why my
IE6 is messed up.
<http://technet.microsoft.com/en-us/library/bb457150.aspx#ECAA>
<http://msdn.microsoft.com/en-us/library/ms537638(VS.85).aspx>

I started noticing that my IE6 seems to be working (or not working)
strangely today.

One thing is that when I got to a website that and click on something
(e.g., a link or button) that normally opens a new window, nothing happens.

Finally, when I try to go to Windows Update, I get to the page where
it's asking to install a new installer, I click "Install Now", and then
get a page that says "Windows Update is downloading and installing the
updated software", then it just sits there (i.e., the new Windows Update
software doesn't seem to get loaded).

I've run Ad-aware, and it didn't find anything. I also have Symantec
Antivirus, and it's not found anything.

Perhaps could you try to disactive your anti virus while you uptodate
something in Windows ?
I think that I was able to reproduce the problem, using a small HTML
page with Javascript for opening a new window:


Try letting address, location and status bars visible.
Notice that actual browsers don't accept in anyway that JS delete(hide)
the status bar.

Try giving an html target's name to your window.open()

var load =
window.open('http://www.yahoo.com','myWin','scrollbars=no,height=600,width=800,resizable=yes');
return false;
}

or (better ?) :

var load =
window.open('http://www.yahoo.com','load','scrollbars=no,height=600,width=800,resizable=yes');
return false;
}

Not tested (my IE.6 isn't updated)
And not more tested in other browsers ...

When I access the above HTML page using my IE6, then click on the "Open
window" link, nothing happens.

never do that :

<a href="javascript:load()">Open Window</a>

but do :

<a href="http://www.yahoo.com" onclick="return load();">Open Window</a>

without forgiven to finish your load function with :
return false;
to break the html link


finaly you could do :

<HTML>
<HEAD>
<Script type="text/javascript">
// Script courtesy from Stephan Moriaux - Your helper in javascript
function load(what) {
var load =
window.open(what.href,'load','scrollbars=no,height=600,width=800,resizable=yes');
return false;
}
</Script>
</HEAD>
<BODY>
<a href="http://www.yahoo.com" onclick="return load(this);">
Open Yahoo!</a>
<a href="http://www.google.com" onclick="return load(this);">
Open Google</a>
</BODY>
</HTML>


I think you can also do:

JS :
====
var load;
function load(what) {
if(!load || load.closed)
load=window.open('','load','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
load.focus;
}

HTML:
=====
<a href="http://www.yahoo.com" target="load" onclick="load();">
Open Yahoo!</a>
<a href="http://www.google.com" target="load" onclick="load();">
Open Google</a>

Knowing that 'target' is obsolete.
Knowing that with JS disblad the links will open in the *same* blank
window (but this window will not pass in front by itself) if not
previously closed.


Perhaps could you read some explainations about 'window' :
<https://developer.mozilla.org/en/DOM/window.open>
<https://developer.mozilla.org/En/DOM/Window>
<http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx>

<https://developer.mozilla.org/En/DOM:window.showModalDialog>
 
T

Thomas 'PointedEars' Lahn

ohaya said:
[Popups don't open]
I've run Ad-aware, and it didn't find anything. I also have Symantec
Antivirus, and it's not found anything.

Chances are that Symantec Antivirus or something related to it is the
problem (a popup blocker). Disk Doctor and Speed Disk aside, it appears to
be best not to use software that carries the Symantec label, particularly
not security-related software.

Deinstall it and replace it with a better scanner (such as Avira AntiVir).

Your system may also have been compromised by malware that neither Ad-Aware
nor Symantec Antivirus detected (which would not be surprising). Have you
updated your Ad-Aware and Antivirus signatures regularly, particularly
before scanning the system? Apply Spybot Search & Destroy and Rootkit
Revealer, too, the latter before everything else.

If you found something, you better set up your system from scratch[1]. From
this point forward you probably wouldn't be running Windows with
Administrator privileges again, which is the default setup. And you
wouldn't be using a seven year old browser again for anything but testing
Web sites.

[1] <http://technet.microsoft.com/en-us/library/cc512587.aspx>

Further questions regarding this are very likely on-topic elsewhere.
I think that I was able to reproduce the problem, using a small HTML
page with Javascript for opening a new window: [...]

Which is not even Valid to begin with, so it can't prove anything.

<a href="javascript:load()">Open Window</a>

Please read the FAQ <http://jibbering.com/faq/> on why not to do that.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top