www.webdeveloper.com
Results 1 to 4 of 4

Thread: Javascript & Blogger

  1. #1
    Join Date
    Feb 2006
    Posts
    22

    Javascript & Blogger

    I want to include some Javascript in my Blogger (minima template) code. It is, in fact, a new version of the Google Analytics code which previously has worked just fine. But this new code, after being saved, replaces all the apostrophes with HTML code for apostrophe (& # 3 9; ), and it doesn't seem to do what it is supposed to.

    The code is copied from the Google Analytics site, so ought to be correct. It is as follows:

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-12345-1']);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_setDomainName', '.myURL'];);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_setAllowHash', false]);

    (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);
    })();

    </script>

    Is there anything obviously wrong with this code that causes the apostrophes to be changed? Or is there no problem with this change, and the fault somewhere else? Thanks.
    Last edited by ercatli; 04-15-2010 at 08:07 AM.

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    That code gives us absolutely no information whatsoever. The place to go is Google Analytics and ask them, because they wrote it.
    Great wit and madness are near allied, and fine a line their bounds divide.

  3. #3
    Join Date
    Jan 2009
    Posts
    3,346
    It sounds like the method used to save the data is altering it. It might be a Blogger restriction.

  4. #4
    Join Date
    Feb 2006
    Posts
    22
    Quote Originally Posted by Declan1991 View Post
    That code gives us absolutely no information whatsoever. The place to go is Google Analytics and ask them, because they wrote it.
    Yeah, I know, but I've tried on the GA forum and so far no answer. So I thought just maybe someone here has come across this before. Thanks for at least replying.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles