I have a View
and Desk.js
file with javascript code.
In the View
:
<script src='@Url.Content("~/Scripts/KazBilet/Desk.js")' type="text/javascript"></script>
In the Desk.js
file:
$(function () {
$('.wraper').load('/desk/getsessionscreen');
toggleSession();
});
function toggleSession() {
alert('a');
$('.sched a').on('click', function () {
var target = $(this);
$(this).toggleClass('selected');
$('.sched a').not(target).each(function () {
$(this).removeClass('selected');
});
setStateForStepButton();
});
}
The elements with sched
class and a
tags contains in partial view which loaded in wraper
div element.
The problem in that click
handler not fire, but alert
calls fine. How to solve it?
Thanks