Register in order to access new features like "Job Alert" and "Buyer Alert"

Login

Login
No account yet? Register

Latest Articles

Auction Factory Banner
Freelancer Jobs arrow Joomla arrow How to avoid overlib to load twice
Jun 17 How to avoid overlib to load twice PDF
There is a problem with multiple loading of Overlib in internet explorer. Joomla uses Overlib for several components, so it's good to be aware of this nasty problem.
 

How can this happen, you ask.
Here's how: let's say you write a module using overlib. to be sure you added a
 mosCommonHTML::loadOverlib();
 
Ok. that's the first one.
 
Then let's assume you have a component that does this too. Now you see how you can get two calls.
 
Firefox - of course - does not care .. but the evil twin Internet explorer does display the infamous yellow error flag and overlib never shows
 
So, now how to avoid it: 
 
if (!function_exists('myLoadOverlib')) {
    function myLoadOverlib () {
        global $mosConfig_live_site;
        $r = "";        $txt .=  '<script language="javascript"> '."\n";        $txt .=  "  if ( !document.getElementById('overDiv') ) {  \n";
        $r .=  "     document.writeln('<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:10000;\"></div>');\n";
        $r .=  "     document.writeln('<script language=\"Javascript\" xsrc=\"$mosConfig_live_site/includes/js/overlib_mini.js\"></script>'); \n";
        $r .=  "  } \n";
        $r .=  "</script> \n";
        return $r;
    }
                   
 
 
Then instead of 
 mosCommonHTML::loadOverlib();
write
 echo myLoadOverlib ();
 
That should solve it 
 
Comments
Add New Search
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
< Prev   Next >