paypal plugin

This blog are helpful for you???? So please Donate! :)





terça-feira, 4 de fevereiro de 2014

export html data to txt file

$(document).ready(function () {
    function export_html_txt($table, filename) {
            var codevaltxt = $table.html();
            // Data URI
            var codetxt = codevaltxt.replace(/\<br\>/g, '\r\n');
            txt_data = 'data:application/text;charset=utf-8,' + encodeURIComponent(codetxt);

        $(this)
            .attr({
            'download': filename,
                'href': txt_data,
                'target': '_blank'
        });
    }
    $("#down-hosts").on('click', function (event) {
        // txt
        export_html_txt.apply(this, [$("#codeval"), 'mars.txt']);
    });
});

Nenhum comentário:

Postar um comentário