<commit_before>function makePostRequest(url, data) {
    console.log(url);
    console.log(data);
    var jForm = $('<form></form>');
    jForm.attr('action', url);
    jForm.attr('method', 'post');
    for (name in data) {
        var jInput = $("<input>");
        jInput.attr('name', name);
        jInput.attr('value', data[name]);
        jForm.append(jInput);
    }
    //console.log(jForm);
    jForm.submit();
}

$(function(){
    $("a[post=true]").each(function () {
        console.log('here');
        $(this).on('click', function () {
            makePostRequest(
                $(this).attr('phref'),
                JSON.parse($(this).attr('pdata'))
            );
        });
    });
});<commit_msg>Fix finalize for safari, firefox.<commit_after>function makePostRequest(url, data) {
    var jForm = $('<form></form>');
    jForm.attr('action', url);
    jForm.attr('method', 'post');
    for (name in data) {
        var jInput = $("<input/>");
        jInput.attr({'name' : name, 'value': data[name], 'type': 'hidden'});
        jForm.append(jInput);
    }
    var button = $("<input type='submit' style='display: none'/>");
    jForm.append(button);
    $("body").append(jForm);
    button.trigger('click');
}

$(function(){
    $("a[post=true]").each(function () {
        $(this).on('click', function (e) {
            e.preventDefault();
            makePostRequest(
                $(this).attr('phref'),
                JSON.parse($(this).attr('pdata'))
            );
        });
    });
});
{'fraction_non_alphanumeric': 0.21899736147757257, 'fraction_numerical': 0.0, 'mean_word_length': 2.34878587196468, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6882107', 'n_tokens_mistral': 485, 'n_tokens_neox': 482, 'n_words': 80}