0
I am unable to call a javascript function from a file. Ex:
Filing cabinet: javascript
inside the briefcase raiz/scripts/javascript.js
function responsivo () {
$('#responsivo').popover({
//trigger: 'manual',
placement: 'bottom',
html: true,
title: 'O que é um site ou software responsivo?',
content: $('#Responsivo').html()
}).popover("show");
};
view
that’s in the folder raiz/views/home/Index.cshtml
<h3 class="div1Texto2">Sites, Softwares e Lojas Virtuais 100% integrados e <span id="responsivo">responsivos</span></h3>
tag head
:
<script src="~/Scripts/javascript.js"></script>
when I turn the page it doesn’t work, but if I put that function on the page it works normally.
I tried to do it too, but it didn’t work:
<script type="text/javascript">
responsivo();
</script>
Obs: I was able to call by putting onload="responsive()" in the tag , but if you have many functions as I do?
I did so <body onload="responsive ()">
– Fabio Souza
and so it worked?
– LocalHost
Not yet tested, I am on the street now, but coming I will test. Thanks for while.
– Fabio Souza
Blz, anything just comment. And in case you use the functions in the tags, you could use Jquery too.... without having to put right in the tag
– LocalHost
@Fabio Souza also have this problem. I am using windows and do not know whether to use or / to enter subfolders. When I put javascript code directly into html it works.
– André Nascimento