• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Quick Reply Doesn't Work in Chrome

Saburov

Active member
#1
Hello. my forum's quick reply function doesn't work properly in chrome and opera browsers. In firefox there is no problem. I cleaned my browsers cache, I tried different computers, disabled addons, even I have try on my friends but the problem continues.

forum.muhasebecafe.com

When I send something with quickreply, the sending symbol at the top right loading forever. Yes the message was sent but page doesn't refreh itself. I have to refresh the page for see my message. What causes this problem?

2016-10-07_15-36-49.png
 

Saburov

Active member
#3
I found the reason of the problem. Because of the google adsense code in the ad_message_body template. When I remove the code, problem solved. I think this is a kind of bug.
 

Chris D

XenForo developer
Staff member
#4
Thanks Chris. But I don't understand exactly. Is there a solution for this? Do you think there is a problem with adsense JS content?


Code:
<xen:hook name="ad_message_body" />
<center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- esnek reklam -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-XXXXXXXXXXXXXX"
     data-ad-slot="8689386314"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>
<br />
Essentially it's a bit of a race condition between the auto detection of the width of the ad slot (presumably these are the "responsive" ads) and the post being inserted into the page by us. For example if their code detects a width of 0 (which is basically correct if the content is currently hidden) then the adsense code falls over and blocks the rest of our code running.

I'm somewhat sure we implemented something which might help, but I'm currently struggling to locate it...
 

Chris D

XenForo developer
Staff member
#5
Somewhat staring me in the face...

Code:
<xen:if is="!{$isShowingNewPosts}">
<center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- esnek reklam -->
<ins class="adsbygoogle"
    style="display:block"
    data-ad-client="ca-pub-XXXXXXXXXXXXXX"
    data-ad-slot="8689386314"
    data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>
<br />
</xen:if>
Note the xen:if conditional now surrounding your existing code; this will prevent the advert code from being loaded when a new post is created, and therefore prevent the problem.