Loading ...
Sorry, an error occurred while loading the content.

counter

Expand Messages
  • terrytesting
    Hi in my index.html i insert the code for a counter but it fails to show up. For example powered
    Message 1 of 3 , Aug 20, 2006
    • 0 Attachment
      Hi in my index.html i insert the code for a counter but it fails to
      show up.
      For example

      <div id="footer" style="clear:both;">
      <div class="metainfo">
      powered by $EDITOR, bash, cat, grep, sed, and
      <a href="http://nanoblogger.sourceforge.net">nb 3.3
      RC4</a>

      <script type="text/javascript">
      document.open();
      document.write("Page hits = ");
      </script>
      <script type="text/javascript"
      src="/counters/unicounter.pl?name=MyPageCounter&trackip=8">
      </script>


      </div>
      <div class="menu">
      <a href="#top">[/\]</a><br />
      </div>
      </div>

      </body>
      </html>

      Am i putting it in the right place ?
      Thanks
    • Kevin W.
      Are you sure you need document.open(); ? I prefer to use the DOM method to display my counter, but this requires a little modifcation to unicounter.pl. First
      Message 2 of 3 , Aug 20, 2006
      • 0 Attachment
        Are you sure you need "document.open();"? I prefer to
        use the DOM method to display my counter, but this
        requires a little modifcation to unicounter.pl. First
        I change the line that says:
        else { print "document.write(\'$Counter\');" }

        to (line shouldn't be split):
        else { print "var tvn =
        document.createTextNode(\'$Counter\');" }

        Then I put this code in my templates/weblog_satus.htm:
        <div id="totalvisits">
        </div>

        <script
        src="/cgi-bin/counters/unicounter.pl?name=MyCounter&trackip=8"
        type="text/javascript">
        </script>

        <script type="text/javascript">
        if (document.getElementById) {
        var tv = document.createTextNode("Total visits: ");

        document.getElementById('totalvisits').appendChild(tv);

        document.getElementById('totalvisits').appendChild(tvn);
        }
        </script>


        Kevin

        --- terrytesting <terrytesting@...> wrote:

        > Hi in my index.html i insert the code for a counter
        > but it fails to
        > show up.
        > For example
        >
        > <div id="footer" style="clear:both;">
        > <div class="metainfo">
        > powered by $EDITOR, bash, cat,
        > grep, sed, and
        > <a
        > href="http://nanoblogger.sourceforge.net">nb 3.3
        > RC4</a>
        >
        > <script type="text/javascript">
        > document.open();
        > document.write("Page hits = ");
        > </script>
        > <script type="text/javascript"
        >
        src="/counters/unicounter.pl?name=MyPageCounter&trackip=8">
        > </script>
        >
        >
        > </div>
        > <div class="menu">
        > <a
        > href="#top">[/\]</a><br />
        > </div>
        > </div>
        >
        > </body>
        > </html>
        >
        > Am i putting it in the right place ?
        > Thanks
        >
        >
        >
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com
      • terrytesting
        ... Tried exactly as you said but still no display. I think i may turn on the web server debugging to see i can spot what the problem is. Thanks
        Message 3 of 3 , Aug 21, 2006
        • 0 Attachment
          --- In nanoblogger@yahoogroups.com, "Kevin W." <un1xt3r@...> wrote:
          >
          > Are you sure you need "document.open();"? I prefer to
          > use the DOM method to display my counter, but this
          > requires a little modifcation to unicounter.pl. First
          > I change the line that says:
          > else { print "document.write(\'$Counter\');" }
          >
          > to (line shouldn't be split):
          > else { print "var tvn =
          > document.createTextNode(\'$Counter\');" }
          >
          > Then I put this code in my templates/weblog_satus.htm:
          > <div id="totalvisits">
          > </div>
          >
          > <script
          > src="/cgi-bin/counters/unicounter.pl?name=MyCounter&trackip=8"
          > type="text/javascript">
          > </script>
          >
          > <script type="text/javascript">
          > if (document.getElementById) {
          > var tv = document.createTextNode("Total visits: ");
          >
          > document.getElementById('totalvisits').appendChild(tv);
          >
          > document.getElementById('totalvisits').appendChild(tvn);
          > }
          > </script>
          >
          >
          > Kevin
          >
          > --- terrytesting <terrytesting@...> wrote:
          >
          > > Hi in my index.html i insert the code for a counter
          > > but it fails to
          > > show up.
          > > For example
          > >
          > > <div id="footer" style="clear:both;">
          > > <div class="metainfo">
          > > powered by $EDITOR, bash, cat,
          > > grep, sed, and
          > > <a
          > > href="http://nanoblogger.sourceforge.net">nb 3.3
          > > RC4</a>
          > >
          > > <script type="text/javascript">
          > > document.open();
          > > document.write("Page hits = ");
          > > </script>
          > > <script type="text/javascript"
          > >
          > src="/counters/unicounter.pl?name=MyPageCounter&trackip=8">
          > > </script>
          > >
          > >
          > > </div>
          > > <div class="menu">
          > > <a
          > > href="#top">[/\]</a><br />
          > > </div>
          > > </div>
          > >
          > > </body>
          > > </html>
          > >
          > > Am i putting it in the right place ?
          > > Thanks

          Tried exactly as you said but still no display. I think i may turn on
          the web server debugging to see i can spot what the problem is.
          Thanks
        Your message has been successfully submitted and would be delivered to recipients shortly.