Sudeep
Sudeep

Reputation: 107

Embedded Javascript

I intend to create an HTML report from a perl script on Linux/Unix side. The report contains various statistics mainly in the tabular format. Since there are many such tables I want to split them into categories using Tabs. The report then will be sent to some email-ids, as an attachment.

The questions are:

  1. Is there a good example of HTML + Javascript to create such tabs? I could not find a complete example

  2. Libraries like jQuery fits the bill except that I need to give the .js file as well, which becomes a bit tedious. Is it possible to somehow embed jQuery (or any other library) in HTML?

Thanks in Advance!

Upvotes: 0

Views: 410

Answers (2)

King Friday
King Friday

Reputation: 26076

Take a teaser approach to this one where its a hybrid of INLINE html + actual links to go to real content.

  1. Just take a screenshot of the real tabs and place as the header image in your email
  2. Below the tabs image, place only the first page of the tab content
  3. Upon clicking the tabs in the email it takes them to the actual page
  4. The URL can be tokenized and be HTTPS so it will be somewhat secure to view via link

The real tabs can use jQuery UI as others have suggested.

Upvotes: 1

Amogh Talpallikar
Amogh Talpallikar

Reputation: 12184

I hope this answers your questions

  1. Use jQuery UI which is an extension of jQuery library, Or you can use ExtJS and there are lots of UI library depending on how much you want.

  2. Why does giving JS file become tedious ? use script tags to call the external JS files to use these libraries. Embedding JS in your HTML will clutter it and its a BAD practice.

Checkout

EDIT:

If you are planning to use JS in emails, forget it. A lot of email clients remove JS content. Instead

  1. Share a google spreadsheet link with email
  2. Generate a PDF that has the report, there are a lot of libraries that convert HTML to pdf , use them and convert an HTML table to PDF.

Upvotes: 1

Related Questions