The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

LinkUp

Continued from here. Just in case anyone is looking for a DOM-based method of opening popups from links. Knocked off these demos (from Al Franken's "Liars..." book & www.theonion.com) pretty quickly, so: it's easy to implement. Suggestions welcome.

OK, I have the beginnings of an article on my site about this code. I also have been able to apply customizations to it with relative ease. Regarding my "wishlist" of allowing the user of this code to choose their own classname, I noticed you had already implemented that idea (just like the AnyBrowser campaign, Best Viewed with Eyes Open, idiot). I made a minor change to the code where I changed span.className = "LU"; to span.className = sLinkClass; which is the variable that stores the "trigger" class name. This I felt would be easier to style rather than having to remember two classnames.

The Opera 7.23 issues still exist with your latest code release. I downloaded Opera 7.5b4 (released today) and it behaves the same as Opera 7.23. You might want to examine the code that Caio Chassot wrote for his article to see how he resolved it because his popups work fine in Opera but don't have the features you have in yours.

OK, I have learned what the problem with Opera is and I suspect that there is nothing that can be done about it: however, I will post a message if there is something.

I put out some messages at various forums and here are some responses I received:

The only time you ever have permissions issues in javascript is when communicating between frame objects, between window objects, or between document objects.

You can control any window which your document creates. But you cannot control the document in that window unless it is in the same domain as the document that created it.

It is my theory that Opera is denying access to something in the document or window becuase you are loading a different domains document into your pop-up. I think opera is just more "paranoid" than ie.

and, in this quote, the person is refering to the error message in the console window:

that always indicate that you are trying to access either a sort of frame or a window, wich has a different source then the current document. opera does not allow to merge local and online source in any way, it is actually very strict about that.

Essentially, Opera has a stricter permissions scheme than most browsers, if not all other browsers. I don't know where this script is exerting control over another window appears in your script but perhaps the change of focus (I'm still testing the script two previous versions before your most current one). If so, is there any way to make the focus optional?

However, that adds another feature which I am reluctant to do. I could just create a notice that Opera behaves differently when opening a page from another domain. But if you want to pursue it, here is an idea. If we add another configuration option such as:

LU_HomeDomain = 'http://jrickards.ca';

and then later in the script, when a popup is triggered, the function checks to see if the href begins with http, if so, is it different than the LU_HomeDomain, if so, don't force focus. You could add another option such as:

LU_ForceFocus = true; // or false

and if it is true, then check the LU_HomeDomain, if false, then don't bother because the focus will not be forced on any link. This adds flexibility so that if the person using the script wishes to open pages from other domains and they know that Opera users are going to view their page or just want to accomodate them, then they can set the LU_ForceFocus to false. However, if they know that their visitors will not be using Opera (for example, IE on an intranet) or none of their popups will open pages from other domains, then they can set LU_ForceFocus to true.

Another possible method would be to provide three LU_ForceFocus options: none, internal and all. None means that LU_ForceFocus will never be employed. Internal means that LU_ForceFocus will only be employed if the popup destination is of the same domain. All means that LU_ForceFocus will always occur. The Internal option would require the LU_HomeDomain configuration but the other two wouldn't matter.