Dear all,
I find the following error occurs when the page loading, in IE 8.
Message: Script error
Line: 0
Char: 0
Code: 0
URI: https://xxxxxxx/piwik/piwik.js
And the piwik code is shown below, please kindly help
<script type="text/javascript">
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca.trim();
//var c =$.trim($(ca).val());
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
}
return "";
}
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://xxxx.hk/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var user=getCookie("user");
_paq.push(['setCustomVariable',
// Index, the number from 1 to 5 where this custom variable name is stored
1,
// Name, the name of the variable, for example: Gender, VisitorType
'username',
// Value, for example: "Male", "Female" or "new", "engaged", "customer"
user,
// Scope of the custom variable, "visit" means the custom variable applies to the current visit
'visit'
]);
_paq.push(['trackPageView']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
I find the following error occurs when the page loading, in IE 8.
Message: Script error
Line: 0
Char: 0
Code: 0
URI: https://xxxxxxx/piwik/piwik.js
And the piwik code is shown below, please kindly help
<script type="text/javascript">
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca.trim();
//var c =$.trim($(ca).val());
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
}
return "";
}
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://xxxx.hk/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var user=getCookie("user");
_paq.push(['setCustomVariable',
// Index, the number from 1 to 5 where this custom variable name is stored
1,
// Name, the name of the variable, for example: Gender, VisitorType
'username',
// Value, for example: "Male", "Female" or "new", "engaged", "customer"
user,
// Scope of the custom variable, "visit" means the custom variable applies to the current visit
'visit'
]);
_paq.push(['trackPageView']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->