Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Opening New Window with a different MIME TYPE

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to build a function that will take an HTML table on one
page and open it in excel in a separate window. The problem I seem to
be having is that when I open a new window using the
method, it's seems to open it as a text/html stream. Here is the code
I use. Each table has a unique ID. I get the HTML and try to open a
new window. The new window still opens as HTML not in EXCEL. The
kicker is that if I save the new window as HTML and then open it
separately - it WILL open in excel!!! (Must use IE v5.01, and using
Java Server Pages)
If anyone can help it would be appreciated


function getTabletoExcel(tableid) {

//find the table by the ID

//get the HTML

//opens in separate window
//still does not open as excel???
excelwindow ="", "EXCEL"); // a window object"application/", "");

//try to set various content types - STILL does not work
excelwindow.document.writeln('<%@ page
contentType="application/" %>');


//If I save the output generated and open it separately it DOES open
in EXCEL!!!
Hot dog! An advertiser loves us THIS much:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic