Giter Site home page Giter Site logo

exporter.js's Introduction

exporter.js

A simple approach to allow downloading of HTML excerpts as several file types: .xls, .csv, .doc or .html

Including this file in your page will create a global Exporter object with a single method export.

This method's signature is:

Exporter.export(DOMElmt, fileName, dataName);

it takes a DOM element whose contents you want to export, the file name for the resulting file (it uses the file extension to determine the format) and optionally a name to be used in Excel files as the Workbook name of the exported .xls.

It supports: Excel (.xls), CSV (.csv, with , as a separator), Word (.doc) and HTML (.html) as file formats.

It works on any modern browser except Microsoft Edge, and it supports older versions of Internet Explorer (I've only tested it down to version 8, but it probably works in earlier versions too).

To use it just add this code to the click event of any link or button:

Exporter.export(data, 'courses.xls', 'Courses');return false;

It supports non-english characters in the data. The included sample .html file is in Spanish so it has plenty of those characters for you to test.

HTH!

exporter.js's People

Contributors

jmalarcon avatar

Stargazers

Elix Froylán Castillo Durán avatar Álvaro Pardo avatar Facundo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.