Question

I get a:

Uncaught TypeError: Object [object Object] has no method 'modalmanager' 

In my script.js file I have:

$('#addShoplistModal').modal('toggle');

Code of my jsp page:

<div class="modal hide fade" id='addShoplistModal'>
<div class='modal-header'>
    <a class='close' data-dismiss='modal'>×</a>
    <h3>Add Shopitem</h3>
</div>

<div class='modal-body'>
    <form id="addShopitemForm">
        <div id="name-error"></div>
        <input type="text" id="name" placeholder="Name" />
        <div id="quantity-error"></div> 
        <input type="text" id="quantity" placeholder="Quantity" />
    </form>
</div>

<div class='modal-footer'>
    <a class="btn" data-dismiss="modal">Cancel</a> 

        <a shoplistId="" id="add-shoplist" class="btn btn-primary">Add</a>
    </div>
</div>
    <script src="<spring:url value="/web/js/jquery-2.0.0.js" />"></script>
    <script src="<spring:url value="/web/js/jquery.validate.js" />"></script>
    <script src="<spring:url value="/web/js/bootstrap.js" />"></script>
    <script src="<spring:url value="/web/js/bootstrap-modal.js" />"></script>
    <script src="<spring:url value="/web/js/script.js" />"></script>

The error is at bootstrap-modal.js at

manager = manager.appendModal ?
            manager : $(manager).modalmanager().data('modalmanager');

Tell me, please, how to fix this problem. Thanks.

Was it helpful?

Solution

The bootstrap.js file should contain all Bootstrap JavaScript features, such as the modal. Therefore, it's not necessary, and obviously breaks things, when you try to include the modal feature library a second time. Just remove bootstrap-modal.js.

OTHER TIPS

I faced the same issue once. Check if you have added jQuery twice. If yes, remove the second jquery. It should work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top