문제

<!-- 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>

I have been mind boggled for about an hour now to no avail. I prefer not to ask questions until I have used all my resources.

도움이 되었습니까?

해결책

From the docs 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:

Have your browser's console open and check for any error statements (are you including the cookie library, for example). Also, use the inspector in your browser to make sure the cookie is actually being set: http://getfirebug.com/cookies

다른 팁

FINALLY!

I figured it out. Joomla issue

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top