I have a hyperlink : <a href="myfile.php"
class="icon_download">&nsbp;</a>
when the user click on the link i change the element class : <a
href="myfile.php" class="icon_loading">&nsbp;</a>

myfile.php create a pdf file a retunr it via header in php :

<?php
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="myfile.pdf"');
// Le source du PDF original.pdf
readfile('myfile.pdf');
?>

So, when the file is loaded and the popup is displayed to save it, i
want to swap the hyperlink's class to "icon_download"


On 10 jan, 12:24, Sanford Whiteman <sa...@figureone.com> wrote:
> > I just want to know if it's possible to add a "load" event or
> > something like this, to an "hyperlink" element (its href url is a
> > file) to know when the popup for saving the file is shown.
>
> You  can't  capture  the  creation  of native elements like the folder
> chooser. And you can stop the default click action, but you can't stop
> the  person  from  using  browser-native  methods  to  follow the link
> without clicking.
>
> And  you obviously can't access the OS native dialog once it's started
> (i.e.  you  can't  click the "Cancel" button on the folder chooser for
> the user)?
>
> What are you actually trying to do here? Explain your requirements.
>
> -- Sandy

Reply via email to