I found this .load( url [, data ] [, complete ] ) in the jQuery documentation. I write this
$('#myModal .modal-body').load($(this).attr('href'));
then the complete html of the href is loaded. If I write this, it's the same
var modalUrl=$(this).attr('href');
$('#myModal.modal-body').load(modalUrl);
But when i do
$('#myModal.modal-body').load('/cms/myPage_1.html #content');
only the part between the #content is loaded. That's what I want. Unfortunately, that doesn't work if I use the variable as a url like
var modalUrl=$(this).attr('href');
$('#myModal.modal-body').load('modalUrl #content');
or
$('#myModal.modal-body').load(modalUrl #content);
or
$('#myModal.modal-body').load(modalUrl + '#content');
Is that even possible? I can't use a fixed url because there are different links on the site
Thanks for your help
$('#myModal.modal-body').load(modalUrl + ' #content');-> Space before#content