All I need is a simple example in how to open a remote content into a Twitter Bootstrap modal window.
I\'m using Bootstrap v2.0.4 and I just can\'t get it to work. I can
First, remote data must fulfill the same origin policy. If you're not satisfying that, everything after this is going to fail (if you are trying to load external URL's, see Twitter Bootstrap external URL's are not working).
There are two ways to accomplish loading remote content into a modal with the Bootstrap data-api. Namely to either specify the remote url to load in the element which triggers the modal or to specify the url in the modal's markup.
In the former, one uses the href property:
Launch demo modal
In the latter, one uses the data-remote property:
The advantage of specifying it in the element is that one could have a different remote url for each
, yet still only use a single modal. Using the data-remote property might be more advantageous in situations where you have multiple means of launching a modal with the same content. Then, no matter what launches it (even a JS call), it would consistently provide the same remote content, without having to duplicate that information across all the methods of invocation.
Here is a demo using the latter method:
The content in the body of the modal is the remote html.