Support » Plugins and Hacks » Extra slashes in source code

Extra slashes in source code

  • I’ve been trying a few plugins trying to get GA to work with my site. I finally see that this one is actually adding some code but it’s coming out strange.

    The source code from my site shows the google analytics tracking code like this

    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push([\'_setAccount\', \'UA-xxxxxxxx-x\']);
      (function() {
        var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
        ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
        var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);

    I can see that the problem is all the extra slashes, how do I prevent those from occurring?


  • The topic ‘Extra slashes in source code’ is closed to new replies.