twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
169.95k stars 78.74k forks source link

modal from 2.1 load remote content only once #4803

Closed zaherg closed 12 years ago

zaherg commented 12 years ago

After closing and opening same modal it will not request content. Adding $.ajaxSetup({ cache: false });

not helped. Is it but or there is some trick to avoid it?

since jsfiddle/jsbin does not support 2.1 yet ..

Joyrex commented 12 years ago

I can confirm this as well - even on pages that are passed url parameters, the first url clicked content will display in subsequent modals, and will persist until page refresh.

zaherg commented 12 years ago

its an old problem #4197 but i dont know why they didnt fix it .

bes89 commented 11 years ago

A workaround: $('body').on('hidden', '.modal', function () { $(this).removeData('modal'); });

More: http://stackoverflow.com/a/12287169/650606

CaMer0n commented 11 years ago

@bes89 Thanks for this. Used it in the admin of our bootstrap based CMS. See: https://github.com/e107inc/e107

lrz-hal commented 11 years ago

Hi everybody, i know this is an old Issue but:

$('body').on('hidden', '.modal', function () { $(this).removeData('modal'); });

only work's in Chrome and Firefox. If i use IE 8,9,10 the content of the modal doesn't reload.

For better unterstanding:

this is my modal

$('#myModalChange').modal({ remote: '/Operation/Change/?dn=' + encodeURIComponent(obj[0].attributes.dn.nodeValue),
keyboard: false, backdrop: "static" })

i used it in jstree. I have debugged the Controler /Operation/Change/ and the controler only called in Chrome or Firefox. In IE he shows directly the modal with the old content.

Any ideas??

Thanks

CarlosBercero commented 10 years ago

That is exactly right. It does NOT work on IE. However, the problem occurs when using the SAME URL. If the URL is different, it works. I worked around the problem using a dummy GUID in the URL.

<a href="LineEdit_Modal.aspx?ID=<%=data.ID%>&g=<%=Guid.NewGuid.ToString%>" data-toggle="modal" data-target="#ModalBox">edit</a>