/    Sign up×
Community /Pin to ProfileBookmark

Mozilla and IE6

Hi all

I have a large application written for IE6 using ASP. Yep, I know, don’t ask, but it’s done and live and has a very small vertical user base.

The client now wants it to work with Mozilla, in fact we are considering a port of the whole app. One feature of IE6 I can’t replicate here is to to with (yep, you guessed it) popups.

The following code works fine in IE6 but not in Mozilla, I assume that this is because Mozilla does not allow popups to be created from the onload function. There are various reasons why the code looks like this, too complex to go into at this stage.

Any comments, can anyone confirm?

Thanks

FG

Copy this lot to TestMoz.asp

<% sVal1 = request.form(“frmTest1”) %>

<html>
<head>
<title>Test Mozilla</title>
<script language=”JavaScript”>

function fTest1(){
document.f.frmTest1.value=”Test1″;
document.f.submit();
}

function fTest2(){
document.f.frmTest1.value=”Test2″;
document.f.submit();
}

var sVal1 = “<% =sVal1 %>”;

function init(){
if (sVal1 == “Test2”){
var oPopup = window.open(“Popup.asp”,”Popup”,””);
oPopup.focus();
//alert(oPopup);
}
}

window.onload=init;

</script>

</head>
<body>

sVal1 = <% =sVal1 %><br />
<form action=”TestMoz.asp” method=”post” name=”f”>
<input name=”frmTest1″ type=”hidden”>
<br />
<a href=”javascript:fTest1()”>test 1 submit</a>
<br />
<a href=”javascript:fTest2()”>test 2 submit</a>
<br />
</form>
</body>
</html>

to post a comment
JavaScript

17 Comments(s)

Copy linkTweet thisAlerts:
@VladdyJul 06.2004 — <note nature="phylosophical">When you start with a beat-up chevy, no amount of work will make it an F1 car.</note>
Copy linkTweet thisAlerts:
@russellJul 06.2004 — Mozilla doesn't block popups by default. It does have a built-in popup blocker though. Lots of people download and install various popup blockers for IE as well. I'd test for the existence of the popup window, and if it doesn't exist, alert a message saying that popups are required for this application. You can even tell them how to allow popups for your site only.
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by Vladdy [/i]

[B]<note nature="phylosophical">When you start with a beat-up chevy, no amount of work will make it an F1 car.</note> [/B][/QUOTE]


Ho ho!

I'll spare you the history, but the customer asked for the app to work this way! And you know what the customer always is!

FG
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by russell [/i]

[B]Mozilla doesn't block popups by default. It does have a built-in popup blocker though. Lots of people download and install various popup blockers for IE as well. I'd test for the existence of the popup window, and if it doesn't exist, alert a message saying that popups are required for this application. You can even tell them how to allow popups for your site only. [/B][/QUOTE]


I've turned off every popup bloker in Mozilla I can find. All other popups in the application work correctly, only the ones generated in this manner don't work.

FG
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — I'll give a bit more detail.

In the application, the user will click on a link, and EXPECT a new window to launch with additional details in it. The original window also displays some additional detail. The original window has to have a form submitted to the server to get the additional data processed. The new window has to be launched for the user to fill in information for the server to process.

This is the way I, the customer, and his customers expect it to work; it's what we all want to happen.

Is there any other way of getting this to happen other than using Javascript?

Any Mozilla specific ideas?

FG
Copy linkTweet thisAlerts:
@steelersfan88Jul 06.2004 — [i]Originally posted by FG1 [/i]

[B]Ho ho!



I'll spare you the history, but the customer asked for the app to work this way! And you know what the customer always is!



FG [/B]
[/QUOTE]
And what someone else always isn't.

So you are saying that you cannot run it even by disabling the pop-up blocking controls? Either you missed something in the controls, or you might have to go another way. I'm not a big fan of changing options to make something work. I use programs, like Camtasia Studio (best example), to do business for me that doesn't require me to teaker any options. ... The point is, it would be better for you to change the program then for the user to change his program. As a business guy, the worst thing you want the customer to do is work, thats your job ?

Dr. Script
Copy linkTweet thisAlerts:
@VladdyJul 06.2004 — [i]Originally posted by FG1 [/i]

[B]Ho ho!



I'll spare you the history, but the customer asked for the app to work this way! And you know what the customer always is!



FG [/B]
[/QUOTE]

The customer most of the times is ignorant and if you listen to him instead of educating, you end up with inferior result.
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by Vladdy [/i]

[B]The customer most of the times is ignorant and if you listen to him instead of educating, you end up with inferior result. [/B][/QUOTE]


In this case, I judged the request to be reasonable, see my post above. I can give chapter and verse on the requirements if needs be, but I don't think that really gets us anywhere, do you?
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by steelersfan88 [/i]

[B]



So you are saying that you cannot run it even by disabling the pop-up blocking controls? [/B]
[/QUOTE]


Yep, that's what I'm saying. I'd be very pleased if someone could try the code in Mozilla, just to check I'm not going nuts.

BTW, I checked it out in Opera, which works the same as IE6.

The application was designed for use on an Intranet with highly restricted access on the Internet. However, even the restricted bits allowed on the Internet rely on the technique outlined above.

If anyone out there who knows ASP and Javascript can suggest an alternate method I'd be pleased to hear it.

FG
Copy linkTweet thisAlerts:
@steelersfan88Jul 06.2004 — Don't even listen to that ... it doesn't matter if the customers knows that its not semantically correct, or invalid code. The customer is always right, and whatever they want makes them happy. If they request it, you should give it, providing it is an idea that would not hurt the program usage of other customers.

"The customer most of the times is ignorant and if you listen to him instead of educating, you end up with inferior result." ha, don't go into business, Vladdy!
Copy linkTweet thisAlerts:
@VladdyJul 06.2004 — In this day and age any request that includes popups for general website is unresonable. Even for custom intranet applications the use of popups can be avoided in 99% of cases.

If you want a modern cross-browser application redefine the requirements and start over - this way you will be doing the job once, not having to do it over once another browser comes along.
Copy linkTweet thisAlerts:
@VladdyJul 06.2004 — [i]Originally posted by steelersfan88 [/i]

[B]The customer is always right, and whatever they want makes them happy. If they request it, you should give it, providing it is an idea that would not hurt the program usage of other customers.[/B][/QUOTE]

- the exuse of bottom feeders.

My customers hire me for my knowledge and ability to transform their vision into a reliable product, not to blindly follow their desires.
Copy linkTweet thisAlerts:
@russellJul 06.2004 — It works for me. Two workarounds (1) call a function whose job it is to call the real function
<i>
</i>window.onload=doIt;

function doIt() {
v = setTimeout("openWin()", 200);
}

function openWin () {
newWin = window.open(url, "popup");
}

Don't know if that will work, since I can't reproduce the problem. (2)The other, more difficult (though more likely to work!) workaround is to fake it with DHTML. Create a DIV with all of the information and form elements that you are putting in your popup. Show it onload if the browser isn't IE.
Copy linkTweet thisAlerts:
@russellJul 06.2004 — this way you will be doing the job once, not having to do it over once another browser comes along.[/QUOTE]

Never true for real world internet applications. New browsers are coming along all the time. IE5 broke IE4 applications, IE6 broke IE5 code. And for you Microsoft haters, don't even get me started on the NS4.xx and the Mozilla daily build...

Programmers must adjust to change. Writing solid code is key to minimizing the pain, but in web programming the only constant is change.
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by Vladdy [/i]

[B] Even for custom intranet applications the use of popups can be avoided in 99% of cases.

[/B]
[/QUOTE]


In this case the customer wanted to see all the data in the original window, have an expanded version of some of it in the popup, and to be able to toggle between the two while the user made some decisions and possibly filled in more data in the popup.

Indeed it could have been done without a popup, but a good deal more clumsily.

This discussion is really getting way off thread. If it comes to re-writing bits of the app, that's what I'll do. I need a Mozilla expert to say "No, Mozilla doesn't do that and never will" and I will have had my question answered. If there is a different answer I'd still like to hear it.


FG
Copy linkTweet thisAlerts:
@russellJul 06.2004 — In this day and age any request that includes popups for general website is unresonable[/QUOTE]

This too, is bologna. Take a look around. Popups have many, many valid and valuable uses (besides advertising). It's a shame we've been hit with so many ads that people got tired of 'em and started blocking all popups, but as programmers we have to work around that.

On an intranet, or in a web application, it is not unreasonable to suggest the use of popups. It is unreasonable to throw away a tool from your toolkit based on snap judgements. For business functionality, it is reasonable to use popups where they are the right tool for the job. It is reasonable to notify your users that they need to accept cookies, have javascript turned on, and allow popups for your application to work.
Copy linkTweet thisAlerts:
@FG1authorJul 06.2004 — [i]Originally posted by russell [/i]

[B]It works for me. Two workarounds (1) call a function whose job it is to call the real function

<i>
</i>window.onload=doIt;

function doIt() {
v = setTimeout("openWin()", 200);
}

function openWin () {
newWin = window.open(url, "popup");
}

[/B][/QUOTE]


Russell

Thanks for your help. Please could you confirm the version of Mozilla in which the code I posted works? Have you made any other adjustments to the settings?

I've tried your option 1 on my system and still no joy, though it does work in IE6.

Thanks again

FG
×

Success!

Help @FG1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...