[jQuery] Re: File download with jQuery.

2007-12-11 Thread lagos.tout

Great idea. Thanks.  Don't know why I didn't think of that - I use the
same method to print sections of a window's DOM.

On Dec 10, 10:43 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> Hi LT,
>
> I don't think you can force a file download with an Ajax request. You may be
> able to (not certain) with an embeded IFrame that has your url as it's
> source.
>
> Cheers,
> -Jonathan
>
> On Dec 10, 2007 4:06 AM, lagos.tout <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
> > Anyone know how to force the browser to treat the data returned by the
> > server in response to $.get( ) as a file, not text or html or xml?
> > I'm using the correct mime-type and know that the file is being
> > returned when I use an href on a link, rather than jQuery.  I could
> > stick with that, but I'd like to know if it's possible to use jQuery
> > to return data that is treated as a file eg. jpg, pdf etc.
> > Thanks.
> > LT


[jQuery] Re: File download with jQuery.

2007-12-10 Thread tlphipps

If you just use a regular link, doesn't the browser just pop-up the
file download window and the original page still stay viewable in the
browser?  I'm not sure why you would need to submit the request via
AJAX for an AJAX-like feel to the app.

On Dec 10, 4:06 am, "lagos.tout" <[EMAIL PROTECTED]> wrote:
> Hi,
> Anyone know how to force the browser to treat the data returned by the
> server in response to $.get( ) as a file, not text or html or xml?
> I'm using the correct mime-type and know that the file is being
> returned when I use an href on a link, rather than jQuery.  I could
> stick with that, but I'd like to know if it's possible to use jQuery
> to return data that is treated as a file eg. jpg, pdf etc.
> Thanks.
> LT


[jQuery] Re: File download with jQuery.

2007-12-10 Thread Jonathan Sharp
Hi LT,

I don't think you can force a file download with an Ajax request. You may be
able to (not certain) with an embeded IFrame that has your url as it's
source.

Cheers,
-Jonathan

On Dec 10, 2007 4:06 AM, lagos.tout <[EMAIL PROTECTED]> wrote:

>
> Hi,
> Anyone know how to force the browser to treat the data returned by the
> server in response to $.get( ) as a file, not text or html or xml?
> I'm using the correct mime-type and know that the file is being
> returned when I use an href on a link, rather than jQuery.  I could
> stick with that, but I'd like to know if it's possible to use jQuery
> to return data that is treated as a file eg. jpg, pdf etc.
> Thanks.
> LT
>