我的JavaScript只在我多次刷新页面时才开始工作。
请查看以下代码 -
<div class="col-xs-6 col-sm-3 js--isotope-target js--cat-2" data-price="14.36" data-rating="4">
<div class="products__single">
<figure class="products__image">
<a href="single-product.html">
<img alt="#" class="product__image" width="263" height="334" src="images/dummy/w263/2.jpg">
</a>
<div class="product-overlay">
<a class="product-overlay__more" href="single-product.html">
<span class="glyphicon glyphicon-search"></span>
</a>
<div class="product-overlay__stock">
<span class="in-stock">•</span> <span class="in-stock--text">In stock</span>
</div>
</div>
</figure>
<div class="row">
<div class="col-xs-9">
<h5 class="products__title">
<a class="products__link js--isotope-title" href="single-product.html">Moringa Powder</a>
</h5>
</div>
</div>
<div class="products__category">
Powders
</div>
</div>
</div>
我曾尝试重置浏览器Javacript(禁用然后重新启用它)但没有任何效果,JavaScript从未在第一次加载页面时工作,我必须多次刷新页面以使javascript正常工作!
答案 0 :(得分:0)
将ver添加到您的JavaScript文件中。 像这样。 myjava.js到myjava.js?v = 1.0
每次更改版本。如果你的.js文件有任何变化。