I have written a web application using jquery that uses the
tabelsorter UI plugin.  The table is built at the time the page is
loaded using XML from the server.  I am trying to allow users to
export the data on the page to an excel spreadsheet.  This is done by
taking the data from the table and posting it to a PHP file I have.
Posting this data rather than pulling it from the server again
preserves user defined sort order and ensures that the user is
exporting what they see on the screen, not any updates the server has
received.  The goal here is to not force the user to navigate away
from the page with the original data on it (since the back button on
some browsers would reload a new copy of the data from the server).

Both methods I've tried involved a hidden form on a new window.  I
figured that with a body onload, I'd have the form post the hidden
data fields to the server and this would act as a sort of redirect.

The first method involved opening the new window and trying to write
the data to hidden fields from the parent.  That didn't work.  I think
timing is the issue there since I think the DOM isn't loaded yet while
I'm trying to fill in the values of those hidden inputs.

The next method I tried was the reverse.  I put a body onload handler
in to pull the data from the parent using a window.opener.$
(#results).html() call (results is the id of my table in the parent).
This gave me permission denied exceptions in firefox and unspecified
errors in MSIE.

Any good examples of how to get this working?

Thanks,
Jake Williams

Reply via email to