how to get URL with two parameters in javascript?

i works in a MVC 4 project, and i have a small problem in my script, this is my script :

    function IsReportCheckpoint(cc,carNum) {
    var url = '/Home/IsReportAlertWebService/'+cc+',' + carNum;//here my problem
    $.ajax({
        type: "Post",
        url: url,
        data: {},
        datatype: 'json',
    });
}

$(function () {
    $("input[name=Report]").on('click', function () {
        var carNumber = $(this).data('carnum'); 
        IsReportCheckpoint(c,carNumber);
});

});

my problem is the script consider the two parameters in the URL as one parameter, so please if someone has any idea i will be very appreciative.

Answers


if using jquery POST, do:

var url = '/Home/IsReportAlertWebService';
    $.ajax({
        type: "POST",
        url: url,
        data: { 'cc' : cc, 'car_num' : carNum },
        datatype: 'json',
       success: function( response ) {
           //response from server here
       }
});

Need Your Help

Exporting font to jar in eclipse

java eclipse fonts export

I'm trying to export a font so that you don't have to install the font to run the game

Append multiple hex numbers to QByteArray simultaneously

c++ qt hex qbytearray

I have bunch of hex numbers, but I don't feel like doing

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.