﻿    function UpdateJS(filePath, itemId) {
        jQuery(document).ready(function ($) {
            if (this.timer) clearTimeout(this.timer);
            this.timer = setTimeout(function () {
                $.ajax({
                    type: 'POST',
                    contentType: "application/json; charset=utf-8",
                    dataType: 'json',
                    url: '/Default.aspx/UpdateAdvertising',
                    data: "{\"itemId\": \"" + itemId + "\" }",
                    success: function (data) {
                        // alert('thanh cong');
                        // document.location.href = filePath;
                        window.open(filePath, "_blank");
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                    }
                });
            }, 1000);
        });
    }
