0
I’m passing the url into the embed (#meuid) thus:
<script>
$('#treinamentos').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget)
var nome = button.data('nome')
var video = button.data('video')
$('#nmTreinamento').text(nome);
$('#meuid').attr('src', 'https://www.youtube.com/watch?v=VaKvZzKyI1s');
})
</script>
The modal with the embed
takes the url but does not display the video:
<div class="modal fade" id="treinamentos" tabindex="-1" role="dialog" aria-labelledby="alterarLabel" style="z-index: 1100;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="exampleModalLabel">Deseja excluir o Treinamento ? </h4>
</div>
<div class="modal-body">
<label for="nmTreinamento" id="nmTreinamento"></label>
<embed id='meuid'
type="application/x-shockwave-flash" fs=1
allowfullscreen="true" allowscriptaccess="always"
width="940" height="440" align="center"></embed>
</div>
</div>
</div>
</div>
There is a way to pass the url into the embed?
Pass a js variable to one of php? That’s it?
– user28595
@Guilhermelautert doesn’t answer that question
– Bia
Bia, "PHP runs on the server side to create the page, and JS runs on the client side with the page already created. The only way they "talk" is via ajax." this in the answer of that question, ie you will have to implement an Ajax :D solution.
– Guilherme Lautert
@Guilhermelautert I did not express myself well, I changed the question to explain what I really wish to do. Anyway thank you.
– Bia
Bia, the signage is "possible duplicate". The correct procedure is to edit the question to show that it is not the case, ideally even including in your text "I read the double question and serves no such-and-such purpose"
– brasofilo
@brasofilo informed before editing, but did not leave.
– Bia
It is only because the question has 4 votes to close as duplicate and some unsuspecting that not reading the comments can give the final vote mistakenly...
– brasofilo