Fixed empty PV issue.
This commit is contained in:
parent
aa23becd14
commit
ad48a9ab06
1 changed files with 8 additions and 6 deletions
|
@ -26,11 +26,13 @@ function countUp(min, max, destId) {
|
||||||
function countPV(path, rows) {
|
function countPV(path, rows) {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
for (var i = 0; i < rows.length; ++i) {
|
if (rows !== undefined ) {
|
||||||
var gaPath = rows[i][0];
|
for (var i = 0; i < rows.length; ++i) {
|
||||||
if (gaPath == path) { /* path format see: site.permalink */
|
var gaPath = rows[i][0];
|
||||||
count += parseInt(rows[i][1]);
|
if (gaPath == path) { /* path format see: site.permalink */
|
||||||
break;
|
count += parseInt(rows[i][1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ function displayPageviews(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasInit = getInitStatus();
|
var hasInit = getInitStatus();
|
||||||
var rows = data.rows;
|
var rows = data.rows; /* could be undefined */
|
||||||
|
|
||||||
if ($("#post-list").length > 0) { /* the Home page */
|
if ($("#post-list").length > 0) { /* the Home page */
|
||||||
$(".post-preview").each(function() {
|
$(".post-preview").each(function() {
|
||||||
|
|
Loading…
Reference in a new issue