Here is the js and the CGI.

You can click on any element and invoke a function. They need not be links.

Here I am invoking a click handler on the h2 title.

  $(function($) {
                $('#dlall').click(function() {
                        $.get('/cgi-bin/dlall', {},
                        function() {
                        location.href= "/dload/jquerysamplesbundle.zip";
                                }, "text");
                });

        })
Instead I could select for $('h2').

Same thing. Then I am invoking an Ajax call to the CGI dlall and once
it finishes
 I am changing the location of current page to the bundle zip file.

You can do this only if the MIME type is not known to the browser.

If it is a video or audio or html or txt or pdf then the browser will
change the page.

In this case it downloads.

The CGI is:

GI;

$q = new CGI;

print $q->header;

unlink("/var/www/htdocs/dload/jquerysamplesbundle.zip");

chdir('/var/www/htdocs');
`/usr/local/bin/zip -r dload/jquerysamplesbundle.zip jquery_tutorials/* `;
`/usr/local/bin/zip -r  dload/jquerysamplesbundle.zip css`;
`/usr/local/bin/zip -r dload/jquerysamplesbundle.zip jquery `;

This is very simple perl code. Mostly done using the zip shell command.

-Girish

-- 
Gayatri Hitech
http://gayatri-hitech.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to