-5
These are the files referring to boot and js. I inserted them in the Layout page
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
My modal
<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<p>Esse procedimento pode levar alguns minutos. Por favor aguarde!</p>
</div>
</div>
</div>
</div>
My javascript
function abreModal() {
$("#myModal").modal({
show: true
});
}
setTimeout(abreModal, 1000);
My button to call Javascript function
@Html.ActionLink("Criar nova tabela de Markup", "Create", null, new { @class = "btn btn-azul wd-270", @onclick = "startLoading();abreModal();", @id = "novaTabela" })
is making this mistake:
Uncaught Typeerror: $(...). modal is not a Function at abreModal (Markup:439)
What is wrong?
When creating a question, try to detail it with important information, I suggest you read how to create a good question here in the community. So are you using the correct bootstrap modal? Which version are you actually using the bootstrap version? The function of this button, you just want it to display the modal is this?
– user148754
Try to put
data-load-url
on your button with the@Html.ActionLink
in it.– Miyukii
@Miyukii, and how I use javascript this, or don’t need
– pnet
It would be in HTML itself, but only now that I saw that you want to take out the HTML button, so it kind of would be necessary to use @pnet
– Miyukii
@pnet You have entered the js file concerning Bootstrap?
– Woss
Manual on how NOT to ask questions. It seems to me to be a good topic for it to be read to avoid pergunats like this.
– Sorack