Pop Up Window Script That Is Multi Browser Supported?

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 23, 2009, 06:12 AM
431070 members and 298133 Topics
Latest Member: wilfrotech
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  Pop Up Window Script That Is Multi Browser Supported?
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Pop Up Window Script That Is Multi Browser Supported?  (Read 145 views)
Afam (m)
Pop Up Window Script That Is Multi Browser Supported?
« on: September 20, 2009, 09:15 AM »

It seems that the level of implementation of standards by browser makers differs to a very uncomfortable level to the extent that what works on one or two browsers won't even work on another.

I was asked to implement a pop up window feature on some links that point to another website some months ago.

Since I was hooked to google chrome I made the mistake or relying on it while developing the application and the javascript enabled popup seem to work just fine until I realized it wasn't responsive or throws up a blank page on some other browsers.

Now, I have checked for the most recent implementations of javascript enabled window popup and after testing 3 of them I found out that none works well across the 3 browsers I targeted - Google Chrome, Microsoft IE and Mozilla Firefox.

This leads to the next question - Is there any good reason to even use pop up windows considering the fact that implementation of standards by browser makers differ from one to the other?

Or, is there an implementation out there that I may have failed to realize or see?

Personally, I would not bother with pop up windows on my own projects for any reasons at all. Links that are bound to open in another window should simply do so with a notification to the user information the user that such links when clicked upon would open in another window.
*dhtml
Re: Pop Up Window Script That Is Multi Browser Supported?
« #1 on: September 20, 2009, 10:05 AM »

Well. . . .i am not perfectly sure of this, but can i see your script implementation? maybe i can patch it to work crossplatform.
I am a little bit reluctant to post anything yet. 'cos i seem to have based all my work on my new library these days, but that
does not mean i cannot still write procedural.
Afam (m)
Re: Pop Up Window Script That Is Multi Browser Supported?
« #2 on: September 20, 2009, 10:26 AM »

Quote from: *dhtml on September 20, 2009, 10:05 AM
Well. . . .i am not perfectly sure of this, but can i see your script implementation? maybe i can patch it to work crossplatform.
I am a little bit reluctant to post anything yet. 'cos i seem to have based all my work on my new library these days, but that
does not mean i cannot still write procedural.

Thanks.

Please see these 2 links.

http://www.alistapart.com/articles/popuplinks/

http://accessify.com/features/tutorials/the-perfect-popup/

Will post the one I used initially before I noticed the cross browser support issue later.

Thanks once again for your time.
yawa-ti-de (f)
Re: Pop Up Window Script That Is Multi Browser Supported?
« #3 on: September 20, 2009, 12:08 PM »

Yes ,I think tis best to c how  u implemented it.

I haven't had any issues with implementing popups across browsers except with respect to heights and widths of the popup itself.

Recently though, I have come to believe that using popups ends up giving the user too many windows too manage and so I have been using jquery's thickbox.  This keeps them on the same page while at the same time creates a cool "effect".

I am familiar with the way a list apart does it and have used it often (where you have an onclick on a link and use an HREF, the latter which comes in very handy if a user disables javascript).

Let's start with seeing your code then we go from there.
*dhtml
Re: Pop Up Window Script That Is Multi Browser Supported?
« #4 on: September 20, 2009, 12:35 PM »

I agree with yawatide. Now my own take:

http://www.alistapart.com/articles/popuplinks/ is very much ok, makes use of the method i normally use except that
document.addEventListener will only work on firefox and other ff based browsers while the equiv on IE is ehm ehm. . .forgotten right now.

Well, using my own framework or jquery framework it is easier to bind events on any platform without selecting browser, that is where that
article in the url i copied failed.

And yes, i hav not used popup windows for a long while now, i prefer to just use all these popin effects like yawatide described and also
use that dynamic window widget used on dynamic drive -

You may want to look at this simple code i wrote here similar to what that your article was talkin about:
Except that i made a provision for popup blockers and also when javascript is disabled.

Quote
<title>My Page</title>
<script>
function popup(link) {
page=link.href;
try {
window.open(page,"");
return false;
} catch(err) {
//possibly popup blocker in place
link.target="_blank";
return true;
}
}
</script>

<a href="pop.html" onclick="return popup(this)">

At times i do not wish to use jquery or any library, i just use: http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
yawa-ti-de (f)
Re: Pop Up Window Script That Is Multi Browser Supported?
« #5 on: September 20, 2009, 01:04 PM »

How about a much simpler approach Wink

Afam, I assume you are referring to http://www.onspeedwestafrica.waresmasons.com/:

Let us look at your code for "find out more" for instance:
Quote
<a target="_blank" onmouseout="rollout();" onmouseover="rollover('find_out_more');" onfocus="this.blur();" href="javascript:popUpWindowSite('http://www.onspeed.com/en/find_out_more.php', 0, 0, 800, 600);">FIND OUT MORE, </a>

I viewed your javascript to find the functions, "rollover" and "rollout" but couldn't.  Do they actually exist but I can't find them?  I also don't see the use of "this.blur()" but I will let that one be as there might be a reason for you implementing this.  I then looked at your "popupwindowsite()" and that looks good. 

Here is the solution I came up with that pulled up the "find out more" page (you might want to remove the comma after "more" while you are at it):
Quote
Exhibit A
<a href="javascript:popUpWindowSite('http://www.onspeed.com/en/find_out_more.php', 0, 0, 800, 600);">FIND OUT MORE, </a>

You could also do it this way, ala a list apart, depending on what you want (this is for when you want the pop up contents to show regardless of whether or not javascript disabled):
Quote
Exhibit B
<a href="http://www.onspeed.com/en/find_out_more.php" onclick="popUpWindowSite('http://www.onspeed.com/en/find_out_more.php', 0, 0, 800, 600); return false;">FIND OUT MORE, </a>

Try "Exhibit A" across all browsers you want your site to support and get back to the house with results.  I will still say though that you look at using the (for example) thickbox effect cos, as dhtml mentioned above, popup blockers abound.

Thanks.
Afam (m)
Re: Pop Up Window Script That Is Multi Browser Supported?
« #6 on: September 21, 2009, 09:28 PM »

@yawatide,

Thanks. The second option worked like magic thanks.
*dhtml
Re: Pop Up Window Script That Is Multi Browser Supported?
« #7 on: September 22, 2009, 09:11 AM »

the jquery thickbox works like that dhtml window. But if you are using jquery already on your site, it is faster and lighter to implement, otherwise just use any of those windows widget found on dynamic drive to maintain light weight websites.
Afam (m)
Re: Pop Up Window Script That Is Multi Browser Supported?
« #8 on: September 22, 2009, 11:27 AM »

Thanks everyone. The issue of pop windows on the website has been taken care of.
*dhtml
Re: Pop Up Window Script That Is Multi Browser Supported?
« #9 on: September 22, 2009, 12:53 PM »

You are very much welcome. All is well that ends well. . .
 Links On Blogs  Preview Dis Magazine Site Pls Critiques  Nairahost Now Offers Free Domain Transfer.  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.