开发者

Getting weird 404 error when using window.open

I am getting a really strange situation.

I am trying to open a window using window.open

myWindow= window.open(myDomain+'/mypath/jsp/loginPage.jsp', 'Window', 'top='+TopPosition+',left='+LeftPosition+',height='+height+', width='+width+', menubar=no, location=0, status=0, scrollbars=no, resizable=no');

Now, here is the problem.

When myDomain is localhost:7001, there are no problems (in Firefox at least). The window opens and displays the correct page. In IE and Chrome, the window opens for a moment and then closes again before giving me a 404 error in the main window.

That's one problem but I don't have to support anything other than Firefox so I could live with the problem in the other two browsers (I just included that info to give you some info that might help).

The real problem is as follows.

When I substitute my network IP address for localhost so that it is http://12.34.56.78:7001 The window flashes and disappears and I also get the 404 error in Firefox and I get the following exception in Firebug's log:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMEventTarget.removeEventListener]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Documents%20and%20Settings/stager/Application%20Data/Mozilla/Firefox/Profiles/ts2cmib6.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D/modules/ObjectTabs.jsm :: anonymous :: line 343" data: no]

[edit]Discovered that disabling AdBlock extension prevents the appearance of the exception. 404 error still an issue though[/edit]

I can't use localhost as the domain because I will eventually have to deploy it to another machine.

Does anyone have any advice to get around this problem?

Thanks in advance.

//Edit开发者_运维知识库 Added http protocol to IP address in post. I was already using it.

//Edit2 Disabling AdBlock plus stopped exception from appearing in Firebug's log. 404 error still present.


This is an AdBlock Plus exception, so perhaps it's blocking you?


By using URLs with a port, you have to use the protocol before the url ("http://" + myDomain). Firefox is tolerant with that if it is localhost...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜