为什么没有jquery警报工作?

时间:2016-11-07 19:52:59

标签: jquery

这种情况持续发生jQuery警报并没有因为看似没有原因而起作用。这发生在我的js文件中的3个或4个。其他一切正常,但alert()console.log()除外。

以下是发布在视图底部的文件:

@section Scripts 
{
    <script src="/Scripts/jquery-1.9.1.min.js"></script>
    <script src="/Scripts/jquery.rateit.js"></script>
    <script src="/Scripts/profile.js"></script>
}

以下是profile.js

$(function () {

alert("hi");

var confirmationId;
var time = false;

$(".contact").on('click', function () {
    $("#contactModal").modal();
});

$(".sendMessage").on('click', function () {
    var email = "nickys2211@gmail.com";
    var body = $("#Message").val();


    $.post("/Authentication/sendEmail", { email: email, body: body}, function () {

    });
});
$(".hiredButton").on('click', function () {
    $("#hireModal").modal();
    var firstName = $("#firstName").val();
    var userName = $("#userLastName").val();
    $("#hireMessage").val("Hi, " + firstName + " can you please confirm that we hired you? \n \n Thanks! \n The " + userName + " Family");
});
$(".sendConfirmationMessage").on('click', function () {

    var userId = $(".hiredButton").data('userid');
    var workerid = $(".hiredButton").data('workerid');
    var userConfirmed = true;
    var email = "nickys2211@gmail.com";
    var body = $("#hireMessage").val();
    $.post("/Authentication/ConfirmHire1", { userId: userId, workerid: workerid, userConfirmed: userConfirmed }, function (confoId) {
        confirmationId = confoId;
        $.post("/Authentication/sendConfirmationEmail", { email: email, body: body, confirmationId: confirmationId }, function () {

        });
    });



});
$(".pastJobs").on('click', function () {
    $("#salesList").modal();
});
$(".times").on('click', function () {
    time = !time;
    if (time == true) {
        $(".timeAvailable").show();
        $(".times").text("Hide Times Available")
    }
    else if (time == false) {
        $(".timeAvailable").hide();
        $(".times").text("See Times Available")
    }
});


});

0 个答案:

没有答案