Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is two-fold.</p> <p><strong>First</strong>, once a Modal object is instantiated, it is persistently attached to the element specified by <code>data-target</code> and subsequent calls to show that modal will only call <code>toggle()</code> on it, but will not update the values in the <code>options</code>. So, even though the <code>href</code> attributes are different on your different links, when the modal is toggled, the value for <code>remote</code> is not getting updated. For most options, one can get around this by directly editing the object. For instance:</p> <pre><code>$('#myModal').data('bs.modal').options.remote = "http://website.com/item/7"; </code></pre> <h3>However, that won't work in this case, because...</h3> <p><strong>Second</strong>, the Modal plugin is designed to load the remote resource <em>in the constructor</em> of the Modal object, which unfortunately means that even if a change is made to the <code>options.remote</code>, <em>it will never be reloaded</em>.</p> <p>A simple remedy is to destroy the Modal object before subsequent toggles. One option is to just destroy it after it finishes hiding:</p> <pre><code>$('body').on('hidden.bs.modal', '.modal', function () { $(this).removeData('bs.modal'); }); </code></pre> <p><sub><strong>Note:</strong> Adjust the selectors as needed. This is the most general.</sub></p> <h2><a href="http://plnkr.co/edit/yMofRZ?p=preview">Plunker</a></h2> <p>Or you could try coming up with a more complicated scheme to do something like check whether the link launching the modal is different from the previous one. If it is, destroy; if it isn't, then no need to reload.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload