Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,587 members, 7,809,123 topics. Date: Friday, 26 April 2024 at 12:06 AM

Pop Up Window Script That Is Multi Browser Supported? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Pop Up Window Script That Is Multi Browser Supported? (3782 Views)

How To Add A Pop-up On Your Wordpress Website / Were To Get A Php Script That Will Be Like Nairaland / An Open Source Social Networking Script That Looks Like Facebook (2) (3) (4)

(1) (Reply) (Go Down)

Pop Up Window Script That Is Multi Browser Supported? by Afam(m): 9:15am On Sep 20, 2009
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.
Re: Pop Up Window Script That Is Multi Browser Supported? by Nobody: 10:05am On Sep 20, 2009
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.
Re: Pop Up Window Script That Is Multi Browser Supported? by Afam(m): 10:26am On Sep 20, 2009
*dhtml:

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.
Re: Pop Up Window Script That Is Multi Browser Supported? by yawatide(f): 12:08pm On Sep 20, 2009
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.
Re: Pop Up Window Script That Is Multi Browser Supported? by Nobody: 12:35pm On Sep 20, 2009
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.

<title>My Page</title>
<script>
function popup(link) {
page=link.href;
try {
window.open(page,""wink;
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/
Re: Pop Up Window Script That Is Multi Browser Supported? by yawatide(f): 1:04pm On Sep 20, 2009
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:
<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):

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):

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.
Re: Pop Up Window Script That Is Multi Browser Supported? by Afam(m): 9:28pm On Sep 21, 2009
@yawatide,

Thanks. The second option worked like magic thanks.
Re: Pop Up Window Script That Is Multi Browser Supported? by Nobody: 9:11am On Sep 22, 2009
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.
Re: Pop Up Window Script That Is Multi Browser Supported? by Afam(m): 11:27am On Sep 22, 2009
Thanks everyone. The issue of pop windows on the website has been taken care of.
Re: Pop Up Window Script That Is Multi Browser Supported? by Nobody: 12:53pm On Sep 22, 2009
You are very much welcome. All is well that ends well. . .
Re: Pop Up Window Script That Is Multi Browser Supported? by limahkerry: 1:51pm On Oct 19, 2017

(1) (Reply)

Buy Your Fresh Spamming Tools... / Design This UI And Earn 10k / Urgent: Help Recover My Article Site Admin's - Articlebeach Script

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 25
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.