@anonymous-piwik-user opened this issue on November 13th 2008

Now JavaScript code to include has document.write. It is bad to sites that has XML MIME, for example: application/xhtml+xml. I write new code that is compatible with DOM:

<html>
<head>
<title></title>
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://URL_to_Piwik" : "http://URL_to_Piwik");
var head= document.getElementsByTagName('head')[0];
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", pkBaseURL + "piwik.js");
head.appendChild(s);
</script>
<script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 2;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
</script>
</head>
<body>
Hello World
</body>
</html>
@mattab commented on November 24th 2008

duplicate of #355

This issue was closed on November 24th 2008
Powered by GitHub Issue Mirror