|
Afam (m)
|
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
|
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)
|
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)
|
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
|
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,""); 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)
|
How about a much simpler approach  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): 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): 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)
|
@yawatide,
Thanks. The second option worked like magic thanks.
|
|
|
|
|
|
*dhtml
|
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)
|
Thanks everyone. The issue of pop windows on the website has been taken care of.
|
|
|
|
|
|
*dhtml
|
You are very much welcome. All is well that ends well. . .
|
|
|
|
|
|