Ekim 10, 2020

Her girişte değişen reklam kodu.

function banner() {
};
banner = new banner();
number = 0;
 
// rastgelegetir
banner[number++] = "<a href='https://site.com'><img src='resim linki'>"
banner[number++] = "<a href='https://site.com'><img src='resim linki'>"

increment = Math.floor(Math.random() * number);
document.write(banner[increment]);

Yukarıdaki kodu banner.js olarak kaydedin. Daha sonra reklamın gözükmesini istediğiniz yere aşağıdaki kodu yazmanız yeterli.

<script src="/banner.js"></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