samedi 14 février 2015

javascript function doesn't work under MVC project


rangeChanged function dosen't work. alert func. dosen't work. but "callbackRangeCalendar" variable is deleted when the alert is working.


is written in a different way in mvc


What do I am missing?


thanks.



@{
ViewBag.Title = "Home Page";
}

@section PageScripts{
<script src="http://ift.tt/1mWWrGH"></script>
<script src="http://ift.tt/Tn4vVI"></script>



<script type="text/javascript" src="http://ift.tt/1CtkLGX"></script>
<script type="text/javascript" src="http://ift.tt/1DswfMh"></script>

<script type="text/javascript" src="@Url.Content("~/Content/calendar/js/jquery.rangecalendar.js")"></script>

<link rel="stylesheet" href="http://ift.tt/1DkjC4j">

<link rel="stylesheet" id="rangecalendar-style-css" href="@Url.Content("~/Content/calendar/css/rangecalendar.css")" type="text/css" media="all">
<link rel="stylesheet" id="rangecalendar-style-css" href="@Url.Content("~/Content/calendar/css/style.css")" type="text/css" media="all">

<link rel="stylesheet" href="http://ift.tt/1m1nt0P">


<script type="text/javascript">
$(document).ready(function () {

var callbackRangeCalendar = $("#cal").rangeCalendar({ theme: "full-green-theme", lang: "tr", changeRangeCallback: rangeChanged, weekends: false });
alert("ddddd");

function rangeChanged(target, range) {


console.log(range);
var startDay = moment(range.start).format('DD');
var startMonth = moment(range.start).format('MMM');
var startYear = moment(range.start).format('YY');
var endDay = moment(range.end).format('DD');
var endMonth = moment(range.end).format('MMM');
var endYear = moment(range.end).format('YY');


$(".calendar-values .start-date .value").html(startDay);
$(".calendar-values .start-date .label").html("");
$(".calendar-values .start-date .label").append(startMonth);
$(".calendar-values .start-date .label").append("<small>" + startYear + "</small>");
$(".calendar-values .end-date .value").html(endDay);
$(".calendar-values .end-date .label").html("");
$(".calendar-values .end-date .label").append(endMonth);
$(".calendar-values .end-date .label").append("<small>" + endYear + "</small>");
$(".calendar-values .days-width .value").html(range.width);
$(".calendar-values .from-now .label").html(range.fromNow);

}

function ragneChanged(target, range) {

console.log(range);
}

});
</script>
<link href="http://ift.tt/1iV9nwj" rel="stylesheet" type="text/css">
}

<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>


<dir class="col-md-12">
<div class="section">
<div id="cal">
</div>
</div>
</dir>




Aucun commentaire:

Enregistrer un commentaire