Take a look at this code snippet:
var data = JSON.stringify({
id: _id,
ReplyId: _idComment
})
openDialog(_url, data, $('#div-modal1'));
function openDialog(url, Id, div) {
//How can we identify if variable Id is of type JSON.stringify?
$.ajax({
url: url,
type: "Get",
data: { id: Id },
}).done(function (result) {
if (result.status == false) {
ShowMessage('warning', result.message, "error")
} else {
div.html(result);
div.dialog("open");
}
});
}
Example usage for an array:
if (grid instanceof Array)
Is there a way to determine if a variable is of type JSON.stringify in the code?