糟糕的javascript? hello bar solo仅在主页上工作 - 没有其他页面

时间:2012-05-17 02:27:09

标签: javascript e-commerce

我正在运营一家大型商店,并在网站页脚中安装了hello bar solo自定义代码。我还尝试在各种位置放置hellobar代码(标题模板文件,默认模板文件,页面特定模板文件)。由于某种原因,hello-bar仅适用于我的主页,但从不在任何其他页面上。

为什么有任何想法?似乎如果我将它放在页脚中它应该出现在每个页面上,但这不是我得到的。如果您需要更多详细信息或代码示例,请告知我们。

感谢

btw,bigcommerce支持还认为如果我在页脚中有这个代码,那么hellobar应该出现在每个页面上,但它不起作用。我的猜测是它是javascript,但我不知道我的方式。

以下是我使用的代码:         

   <div id="mailchimp_form" style="display:none;">
<form action="http://xxxxx.us5.list-manage.com/subscribe/post" method="POST">
<input type="hidden" name="u" value="xxxxxxxx">
<input type="hidden" name="id" value="xxxxx">
Get an instant coupon code by signing up to our newsletter.  Email: <input type="email" autocapitalize="off" autocorrect="off" name="MERGE0" id="MERGE0" size="25" value="" />
<input class="button" type="submit" value="Subscribe" />
</form>
</div>
<!-- Hello Bar configuration start -->
<script type="text/javascript">
var mailChimpForm = document.getElementById('mailchimp_form').innerHTML;
new HelloBar( mailChimpForm, {
    showWait: 1000,
    positioning: 'sticky',
    fonts: 'Arial, Helvetica, sans-serif',
    forgetful: true
}, 1.0 );
</script>

以下是我在标题中提到的参考资料:

<link type="text/css" rel="stylesheet" href="content/hellobar.css" />
<script type="text/javascript" src="content/hellobar.js"></script> 

1 个答案:

答案 0 :(得分:0)

不知道大商业是什么,但从您提供的产品来看,我猜测其中一个原因。

  1. 除了您的主页外,没有'mailchimp_form'div。
  2. 由于一些奇怪的原因,Javascript会在“mailchimp_form”div加载到所有其他页面之前执行。