Z
Z
zigen2015-04-28 16:42:38
JavaScript
zigen, 2015-04-28 16:42:38

How to load bootstrap modals in django?

Good afternoon.
In my project, in the base template, there are several modal windows for registration and authorization.
I would like to remove them in separate html files.
Made through {% include 'mymodalwindow.html' %} - everything works OK. But it's annoying that it is automatically loaded into the base template all the way.
Tell me if it is possible to implement the same, for example, through js, jquery, in order to load and show the window by .onclick ().

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2015-04-28
@zigen

urls.py

url(r'^whatever/$', view_whatever, name='view_name'),

html
js
var $place = $( "#place" );
$place.load( $place.data('load-from') );

jQ load - takes from the cache!

R
robotcigan, 2015-04-28
@robotcigan

$('#myModal').modal('show');
PS
getbootstrap.com/javascript/#modals
All modal details

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question