SSL Labs Score

Log in to participate

There is no cost to join RicheyWeb, and membership is a requirement to submit bug reports and participate in the support forums.

× Extension Discussions

HeadTag - creates error on frontend w roksprocket

More
3 weeks 3 days ago - 1 week 1 day ago #392 by vthomas
vthomas created the topic: HeadTag - creates error on frontend w roksprocket
EDITED: I found the cause of the error. When I am using headtag in any of my rocketheme gantry 4 templates, the javascript from your plugin gets added at end of exising js script, which breaks the original script. The fix was to begin my Headtag js declaration with </script> then add my script. ...then the original script is 'closed' before my added script starts. I don't know why this is happening, but I can't use this plugin for this reason.
================
Original post:

Hi, I installed HeadTag on two sites that also use rockettheme's RokSprocket module. When HeadTag enabled, I get this error (below), and roksprocket is non-functional. This is the error:

if (typeof RokSprocket == 'undefined') RokSprocket = {}; Object.merge(RokSprocket, { SiteURL: ' dressagenaturally.net/ ', CurrentURL: ' dressagenaturally.net/ ', AjaxURL: ' dressagenaturally.net/index.php?option=c...ormat=raw&ItemId=101 ' }); window.addEvent('domready', function(){ RokSprocket.instances.headlines = new RokSprocket.Headlines(); }); window.addEvent('domready', function(){ RokSprocket.instances.headlines.attach(167, '{"accordion":1,"autoplay":"0","delay":"2"}'); }); window.addEvent('load', function(){ var overridden = false; if (!overridden && window.G5 && window.G5.offcanvas){ var mod = document.getElement('[data-headlines="167"]'); mod.addEvents({ touchstart: function(){ window.G5.offcanvas.detach(); }, touchend: function(){ window.G5.offcanvas.attach(); } }); overridden = true; }; });

(btw, I see this error even when I set joomla error reporting to NONE)

When HeadTag disabled OR I remove the js content from the plugin and keep the plugin enabled, the error goes away. So, I'm baffled. I can't see anything in the js itself that was added to HeadTag that seems like it would conflict - this was what I pasted into HeadTag as the script declaration:

<!-- Google Code for Remarketing Tag -->
<!
Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: google.com/ads/remarketingsetup
>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxx;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/827240055/?guid=ON&script=0"/>
</div>
</noscript>
<!-- Google Code for Habits for Excellent Horsemanship Purchase Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxx;
var google_conversion_label = "xxx";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion...?label=zsKGCKbjvnkQ99y6igM&guid=ON&script=0"/>
</div>
</noscript>

Have I misunderstood how to use HeadTag? I did see the js code properly in the head tag. Could the code, in the way I posted it w/comments, etc, be a cause? Any suggestions you have are appreciated!
Sincerely,
Vicky
Last Edit: 1 week 1 day ago by vthomas.

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #396 by vthomas
vthomas replied the topic: HeadTag - creates error on frontend w roksprocket
I found the cause of the error. When I am using headtag in any of my rocketheme gantry 4 templates, the javascript from your plugin gets added at end of existing js script, which breaks the original script. The fix was to begin my Headtag js declaration with </script> then add my script. ...then the original script is 'closed' before my added script starts. I don't know why this is happening, but I can't use this plugin for this reason. I can't tell if it is how gantry 4 template is set up or how your plugin adds the script. Vicky

Please Log in or Create an account to join the conversation.

More
5 days 13 hours ago #399 by michael
michael replied the topic: HeadTag - creates error on frontend w roksprocket
Headtag adds the <script> tags for you. It puts all scripts into the <head> (which is why it's called HeadTag) and that precludes the presence of what you've got listed above. <div> tags can't exist in the <head>, neither can <noscript> tags.

headtag:script is for adding a <script type="text/javascript" src="..."></script>
headtag:scriptdeclaration is for adding <script type="text/javascript">...</script>

There is no facility in headtag to inject images, divs or anything other than scripts, script declarations, stylesheets, styles or custom tags to anywhere except the <head>

Please Log in or Create an account to join the conversation.

More
4 days 22 hours ago #401 by vthomas
vthomas replied the topic: HeadTag - creates error on frontend w roksprocket
Hi, thank you for that explanation. Best Regards, Vicky

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Kunena Forum