0
我有一些HTML引導鏈接在模態不工作:JQuery的錯誤
<div class="modal fade" id="product-add-to-cart-modal-ssbt" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="row quick-view product-main">
<div class="col-sm-12">
<p class="lead text-center">One <b>{Product Name}</b> will be added to your cart.
</p>
<div class="box">
<p class="text-muted text-small text-center">
What do you want to do next?
</p>
<div class="box-footer" id="add-to-cart-buttons">
<a href="?add_product=10161">
<i class="fa fa-reply"></i>Return to current page
</a>
<a href="/site/cart?add_product=10161">
<i class="fa fa-shopping-cart"></i>Go to shopping cart
</a>
</div>
</div>
<!-- /.box -->
</div>
</div>
</div>
</div>
</div>
<!--/.modal-dialog-->
</div>
<button class="btn btn-primary" data-toggle="modal" data-target="#product-add-to-cart-modal-ssbt" onclick="return false;">Add to cart</button>
當我點擊任何在我的模態的兩個環節,它不會去任何地方。望着控制檯,我看到這個錯誤:
Uncaught Error: Syntax error, unrecognized expression: ?add_product=10161
然後引用jQuery的1.11.1.min.js:2右側。
我無法在JSFiddle中複製我的錯誤。它在那裏工作。看到這裏:http://jsfiddle.net/gk6o4cmr/
有人可以幫我找出我的代碼有什麼問題嗎?
嘗試分配完全限定的URL - * http:// ....?add_product = 10161 * – 2015-04-01 08:36:52
未捕獲的錯誤:語法錯誤,無法識別的表達式:http:// ...?add_product = 10161 – narfie 2015-04-01 08:39:11
試試這個http: //jsfiddle.net/shaun1ak/suun90a2/。我修改了'',並且使用了jQuery。出於某種原因,Modal不適用於查詢參數。 – 2015-04-01 08:52:00