From: Steve Sutton Date: Thu, 16 Mar 2017 20:43:59 +0000 (-0400) Subject: Update for js error and template error X-Git-Tag: v1.0.0^2~23 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=939eb34b06b59663c700fbe730dc8f1346ba13af;p=WP-Plugins%2Fglm-member-db-apis.git Update for js error and template error Fixes for errors in the smarty template and in the js. --- diff --git a/js/front.js b/js/front.js index 91b47d5..896da02 100644 --- a/js/front.js +++ b/js/front.js @@ -31,8 +31,10 @@ jQuery(document).ready(function($){ return false; } } - var body = document.getElementById("google-div"); - body.style.display = 'none'; + if ($("#google-div").length > 0) { + var body = document.getElementById("google-div"); + body.style.display = 'none'; + } return true; } @@ -74,9 +76,11 @@ jQuery(document).ready(function($){ { try { - var body = document.getElementById("google-div"); - body.innerHTML = ''; - body.style.display = ''; + if ($("#google-div").length > 0) { + var body = document.getElementById("google-div"); + body.innerHTML = ''; + body.style.display = ''; + } var dialog = document.createElement("div"); dialog.className = "customDialog"; @@ -123,7 +127,9 @@ jQuery(document).ready(function($){ attachEventListener(dialogButton, "click", mySubmit, false); dialog.appendChild(dialogButton); - body.appendChild(dialog); + if ($("#google-div").length > 0) { + body.appendChild(dialog); + } var scrollingPosition = getScrollingPosition(); var viewportSize = getViewportSize(); @@ -261,8 +267,10 @@ jQuery(document).ready(function($){ return false; } } - var body = document.getElementById("google-div"); - body.style.display = 'none'; + if ($("#google-div").length > 0) { + var body = document.getElementById("google-div"); + body.style.display = 'none'; + } return true; }