R
R
Roman2014-02-09 19:02:34
JavaScript
Roman, 2014-02-09 19:02:34

Bootstrap 3: is it possible to load only a part of the page into the modal window, for example from a block?

The situation is as follows:
- There are several buttons to call the modal window:

<a href="#myModal" data-toggle="modal" data-load-remote="/shop/items/item.html" data-remote-target="#myModal .modal-body">Ссылка 1</a>

- When you click on the button, content from another page is loaded. Content is loaded using "data-load-remote" :
$('[data-load-remote]').on('click',function(e) {
    e.preventDefault();
    var $this = $(this);
    var remote = $this.data('load-remote');
    if(remote) {
        $($this.data('remote-target')).load(remote);
    }
});

The difficulty is that the page in the modal window is loaded entirely. Is it possible to load only part of the page into the modal window, for example from the block ?
<div id="content"></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Petrusha Ukropov, 2014-02-09
@Fog666

$($this.data('remote-target')).load(remote + " #content");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question