Rogue Javascript in v4.3 theme – is it needed?

Posted in: Newspaper
Post count: 109

Re: version 4.3

I’m wondering if there is a rogue javascaript tag running loose

<script type="text/javascript"></script>

In the Theme Panel/Custom Javascript:

I have pasted my code beginning with a comment tag and then the opening javascript tag, it looks like this:

<!-- Begin pap click code -->
<script type="text/javascript"><!--
document.write ... ... etc

When I view the source after loading the page I see an extra tag:

<strong><script type="text/javascript"></strong><!-- Begin pap click code -->
<script type="text/javascript"><!--
document.write ... ... etc

And of course there is an extra closing tag also.

<strong></script></strong><link rel='stylesheet' id='td-bootstrap-css' href='h ...

The possible extra tags are found just after this code:

    <!--
        Theme: Newspaper by tagDiv 2014
        Version: 4.3 (rara)
        Deploy mode: deploy
        Speed booster: v2.5

    -->

    
            <style type="text/css" media="screen">
                .post .meta-info {
display: none;
}

.post .td-post-text-content {
margin-top: 5px;
}

.single ul {
list-style-image: url('/images/list-style-check.png');
}

.single ul li {
line-height: 30px;
}
                </style><strong><script type="text/javascript"></strong><!--

Am I to paste my tracking code without the opening javascript tag? Seems strange to do this.

Any how I am having trouble with the sales tracking of my site since I pasted the tracking code in the theme panel and I am wondering if it’s becuase of a superfluous piece of extra code..i.e. an extra javascript opening and closing tag.

Please advise.

Post count: 6600

Hi,

When you use custom javascript to add js code using theme panel you don’t need to add the <script></script> tags, this tags are added by this function from functions.php file: http://screencast.com/t/kil6cUhS so you will have to add just the raw js code there.
You can use the Analitics to keep tracking of your site: http://screencast.com/t/ZUaaVL4Na9R2
The theme doesn’t add any <strong></strong> tags, this may come from other plugins so you could also try to empty cache and/or purge files if you use any cache/CDN plugins then deactivate all plugins and check again.

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 109

Thank you. I am using Sales Tracking code for an affiliate program, and I paste the code within custom javascripts section. I have analaytics going in the analytics section.

I’ll try my tracking without the duplicate tags. The strong tags was just me emphasizing within my post to you.

Thanks so much for your support.

Post count: 109

Quick question, what if I need to paste two different javascripts in there? Do i remove the opening tag and closing tag for each script?

Post count: 109

Had to remove the code and put it in the footer file. I think it would be better if the template did NOT place javascript tags, But was simply a place holder for any code that we want to execute. This way I don’t have to keep copying the code to every footer file for every template update.

Not all code starts and ends with those javasript tags. I’m using Statcounter and Post Affiliate pro and those built in javascript tags in the functions file are messing it up.

=)

Post count: 6600

Hi,

Thanks for letting us know, we will consider this and try to find a better way to implement this in future updates. Should work fine for you in the footer.

Thanks for the suggestion!
Have a nice day!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.