Page 1 of 1

Adding a counter to exported web pages

Posted: Sun Feb 14, 2010 8:26 pm
by j.loh
Hi,

I would like to add a counter to the web pages exported by K+K. I decided to use statcounter.com, they can generate a XHTML snippet that I have to add to my web pages, but as AFAIK K+K doesn't allow me to add it to my pages in a W3C compliant way.

The only places I found are the "Global header" and "Global footer" fields in the "Export WWW files" dialog. The result is that the code is wrapped inside <div><p> tags (similar for the footer):

Code: Select all

<div class="global_head">
<p><!-- the counter code --></p>
</div>
Inside this tags, the code doesn't validate, in particular the <noscript> tag isn't allowed in this context.

Is there another way to include the code to the pages?

Regards,
Jürgen

Re: Adding a counter to exported web pages

Posted: Mon Feb 15, 2010 1:36 am
by j.loh
Hi,

I found a very simple solution myself. I added a </p> before and a <p> after the counter code:

Code: Select all

</p><!-- the counter code --><p>
K+K simply copies this to the web pages. The result is that the counter code is outside the <p> tags:

Code: Select all

<div class="global_head">
<p></p><!-- the counter code --><p></p>
</div>
The empty <p></p> paragraphs are ignored by the browser - perfect! :D

Regards,
Jürgen