ajax - how to get URL with two parameters in javascript? -
i works in mvc 4 project, , have small problem in script, script :
function isreportcheckpoint(cc,carnum) { var url = '/home/isreportalertwebservice/'+cc+',' + carnum;//here 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 script consider 2 parameters in url 1 parameter, please if has idea appreciative.
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 server here } });
Comments
Post a Comment