Reputation: 1003
Maybe someone can help me to understand what is the problem, I have been spending hours into google for a solution.
I am using: ASP.NET entity framework
I have a view with this code:
<button type="button" id="btnGraficoNew">GeneraGrafico</button>
<div id="msgError"></div>
<div id="contenedorGrafico"></div>
@section scripts{
@Scripts.Render("~/bundles/highcharts")
@Scripts.Render("~/bundles/paraGrafico")
<script type="text/javascript">
$(document).ready(function () {
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
$("#btnGraficoNew").click("click", function () {
alert("dentro de a");
AlertaMensaje("hola mundo");
ListaPubli(1, 1, 1);
});
});
</script>
}
When I run the program the browser alert me with: "Uncaught ReferenceError: AlertaMensaje is not defined" but If I check into the page code the call exist.
Into google dev tools this is what I can see
Any idea?
Upvotes: 0
Views: 665
Reputation: 1003
The problem was that inside "paraGrafico.js" there was a javascript code error.
url: "@Url.Action("method", "controller")",
change to
url: '@Url.Action("method", "controller")',
After to solve it the browser call the function without problem.
Upvotes: 1