<!-- Modal -->
<div id="appsmodal" class="modal hide fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
if($.cookie('msg') == 0)
{
$('#appsmodal').modal('show');
$.cookie('msg', 1);
}
});
</script>
我一直在为大约一个小时而烦恼,但无济于事。在使用我所有的资源之前,我不想问问题。Jquery Cookie代码不能正常工作
这是一个.length的东西?如果(!$。cookie('msg')。length)还是类似的?如果cooke'msg'没有被设置,它不会等于0.它不会存在。 – orolo
.length?是吧? jquery cookie.js和bootstrap modal – Binary101010
我想知道如果你是否“如果($ .Cookie('味精')== 0)永远不会返回true,因为如果你还没有设置$ .cookie('味精'),它不会== 0它只是不会存在,但是,询问$ .cookie('msg')。length == 0是否可能会返回所需内容 – orolo