Skip to content Skip to sidebar Skip to footer

Bootstrap 2.3.1 - Modal With Remote Doesn't Load First Time, But Does After The First Time

I have a bootstrap modal that loads remote content. This does not work the first time the link is click. The modal comes up, but remote content is not loaded. I checked the logs, a

Solution 1:

I never did figure out why Bootstrap wasn't loading it properly, but did use the following work around:

$('.modal-body').text('Loading content...');
if (firstLoad) {
      $('#myModal .modal-body').load($(this).attr("href"))
      firstLoad = false;
 }

The boolean firstLoad falls back to jquery to load the div content on the first load only.


Post a Comment for "Bootstrap 2.3.1 - Modal With Remote Doesn't Load First Time, But Does After The First Time"