I know this is very basic question but
Is this a good practice although code works fine?
I'm working on mvc project and i just need to confirm wether it is a good practice to do this or not?
code .cshtml
$(document).ready(function () {
var serviceURL = '/AjaxTest/FirstAjax';
if(serviceURL = null ) { alert ("BANG! error")}
else {
$.ajax({
type: "POST",
url: serviceURL,
data: param = "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: successFunc,
error: errorFunc
});
}
}
please share your comments.