Skip to content


Subversion checkout URL

You can clone with
Download ZIP


modal from 2.1-wip load remote content only once #4197

slbug opened this Issue · 15 comments

9 participants


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?


Hey @slbug,

Thanks for opening this issue! Unfortunately, it looks like it fails to pass the criteria necessary for submitting to bootstrap. The following things are currently failing:

  • should include a jsfiddle/jsbin illustrating the problem if tagged with js but not a feature

For a full list of issue filing guidelines, please refer to the bootstrap issue filing guidelines.


@fat fat closed this

I don't see that the issue is resolved. In the example above I see the same problem. I tried the code change in Pull Request #4224 and see no difference in behavior. Anyone have this working?


@jcombsctx if you applied patch from #4224 then don't forget to add cache: false option in modal setup


I've tried that to no avail. I am using the data API


data-toggle='modal' data-target='#modal_dialog' data-cache='false' works for me


I would not only want the modal to reload each time, but also accept new options. For example, I have a table where each row has a button to show the modal. It would be wasteful to create one modal div per row, so I'd prefer re-using one, but re-load the content. Currently, when invoking the modal, it will not accept new options the second time it's created, which means that even if I reload the contents, it has not changed the remote URL option. Will see if I can fix a pull request for this but I'm a newbie on JS unit testing so let's see.
UPDATE: See pull request fixing this here: #4392

xps commented

Doesn't help me either as I'm looking to load a different URL...


@xps there is a pull request to accept new options here #4392
So when it can accept new options, you just need to add an event listener to the show event on the modal, and reload the body with one ajax request.


@slbug which version you are using? data-cache='false' doesnt work


Found a workaround:
$('body').on('hidden', '.modal', function () {

More info:


not sure, some revision from 2.1-wip just before ~ 2 weeks before release of 2.1


check my fork, branch 2.1-wip


$('body').on('hidden', '.modal', function () {

worked for me. Thanks


Since the modal is initialized with options, why not allow a cache: false option? It seems more proactive than setting a listener-- shorter too.


@danschumann The feature was rejected in #13788. Subsequently, we opted to deprecate remote modals altogether in #14034.


Locking this issue due to its age.

@cvrebert cvrebert locked and limited conversation to collaborators
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Something went wrong with that request. Please try again.