﻿
function ajaxRequest(url, jsonData, process, storeId, isAsync) {
    if (storeId == undefined) {
        // add random string on the end of url to prevent browser caching
        url = url + "?Time=" + new Date().getTime();
    }
    else {
        url = url + "?StoreId=" + storeId + "&Date=" + new Date().getDate();
    }

    if (isAsync == undefined || isAsync == true) {
        $.ajax({
            type: "POST",
            url: url,
            data: jsonData,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: process
        });
    }
    else {
        $.ajax({
            type: "POST",
            url: url,
            async: false,
            data: jsonData,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: process
        });
    }
}
