Aralık 1, 2020

Sayfayla birlikte açılan popup kodu

<script type="text/javascript">
var puShown = false;
        function doOpen(url)
        {
                if ( puShown == true )
                {
                        return true;
                }
             win = window.open(url,"yenipencere","menubar=0,resizable=1,width=1,height=1");
             win.moveTo(150000, 150000); 
                if ( win )
                {
                        win.blur();
                        puShown = true;
                }
                return win;
        }
        function setCookie(name, value, time)
        {
            var expires = new Date();
            expires.setTime( expires.getTime() + time );
            document.cookie = name + '=' + value + '; expires=' + expires.toGMTString();
        }
       function getCookie(name) { 
var cookies = document.cookie.toString().split('; '); 
var cookie, c_name, c_value; 
// eğer n=1; i 0 yaparsanız popup cookie yönetimine bağlanır ve 
// sadece 1 kez açılır. n=1; kaldığı sürece popup sürekli açılacaktır. 
for (var n=0; n<cookies.length; n++) { 
cookie = cookies[n].split('='); 
c_name = cookie[0]; 
c_value = cookie[1]; 
if ( c_name == name ) { 
return c_value; 
                }
            }
            return null;
        }
        function initPu()
        {
                if ( document.attachEvent )
                {
                        document.attachEvent( 'onclick', checkTarget );
                }
                else if ( document.addEventListener )
                {
                        document.addEventListener( 'click', checkTarget, false );
                }
        }
        function checkTarget(e)
        {
            if ( !getCookie('esl') ) {
                var e = e || window.event;
                var win = doOpen('https://google.com/');
                setCookie('esl', 1, 1*60*60*1000);
            }
        }
initPu();
</script>

 

You may also like...

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


Fatal error: Uncaught Error: Call to undefined method Ressio_HtmlOptimizer_Dom_Element::addChild() in /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/dom.php:182 Stack trace: #0 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/widgets/widgets.php(66): Ressio_HtmlOptimizer_Dom->appendScriptDeclaration('!function(e,t,n...', Array, Object(Ressio_HtmlOptimizer_Dom_Element)) #1 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/widgets/widgets.php(151): Ressio_Plugin_Widgets->injectJsLoader(Object(Ressio_HtmlOptimizer_Dom), Object(Ressio_HtmlOptimizer_Dom_Element)) #2 /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php(117): Ressio_Plugin_Widgets->onHtmlIterateTagSCRIPTBefore(Object(Ressio_Event), Object(Ressio_HtmlOptimizer_Dom), Object(Ressio_HtmlOptimizer_Dom_Element)) #3 /home/altiltoy/siteler/serdarakyol.com/wp-content in /home/altiltoy/siteler/serdarakyol.com/wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/dom.php on line 182