0
<!-- 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…&lt;/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>

我已经困惑了大约一个小时,但无济于事。在我用尽所有资源之前,我宁愿不提问。

4

2 回答 2

1

从文档https://github.com/carhartl/jquery-cookie

Create session cookie:

$.cookie('the_cookie', 'the_value');
Create expiring cookie, 7 days from then:

$.cookie('the_cookie', 'the_value', { expires: 7 });
Create expiring cookie, valid across entire site:

$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });
Read cookie:

$.cookie('the_cookie'); // => "the_value"
$.cookie('not_existing'); // => undefined
Read all available cookies:

$.cookie(); // => { "the_cookie": "the_value", "...remaining": "cookies" }
Delete cookie:

打开浏览器的控制台并检查是否有任何错误语句(例如,您是否包括 cookie 库)。此外,使用浏览器中的检查器确保 cookie 确实被设置: http: //getfirebug.com/cookies

于 2013-04-01T20:14:47.970 回答
1

最后!

我想到了。Joomla 问题

于 2013-04-02T03:53:48.563 回答