我在我们的网站上遇到问题,几天前谷歌地图不再显示。
这是它不起作用的页面的两个链接:
链接 1 - 项目详细信息页面
链接 2 - 项目类别页面
它们都使用相同类型的代码工作,并且直到一天前都运行良好。
上次它不起作用是因为有人没有在 lat long 坐标部分插入正确的数字类型。
这是执行此操作的代码,以防有人遇到同样的问题。请参阅下面的答案(谢谢乔纳森库恩!)
<script type="text/javascript">
Shadowbox.init({
// let's skip the automatic setup because we don't have any
// properly configured link elements on the page
skipSetup: true
});
<?php
session_start();
if (empty($_SESSION['count'])) {
$_SESSION['count'] = 1;
}
else {
$_SESSION['count']++;
}
?>
window.onload = function() {
// open a welcome message as soon as the window loads
<?php
if ($_SESSION['count'] == 1) {
?>
Shadowbox.open({
content: '<div id="welcome-msg"><p style="padding:4px 30px; margin:4px; color:#fff;">Awesome stories, photos, news, and more on our projects, straight to your inbox.</p><p style="padding:4px 30px; margin:4px; color:#fff;">Enter your e-mail and click Submit to join.</p><form method="post" name="newsletter" action="include/newsletter_submit.php" onsubmit="return validateForm_newsletter()" style="padding:10px 30px;"><input type="text" name="email_address" class="newsletter_textbox"> <input type="submit" name="button" class="newsletter_button" value="Submit" style="margin-top:10px;"><p style="padding:18px 15px; margin:4px; color:#fff;">You can also enter your e-mail at the bottom of our homepage.</p></form></div>',
player: "html",
title: "Get our friendly updates!",
height: 250,
width: 350
});
<?php } ?>
};
</script>