Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation refresh page after click on href

    Hey guys, nice to meet you all
    I'd like to know if there is some way to refresh a page after the user has clicked on a link that allows him to download a file. This is my code

    < a href="file_to_download" onClick="refreshPage()">
    Click here to download
    </a>

    The problem here is that when I click on the link, I get the dialog open/save/cancel but I dont get my page refreshed
    This code is not working the way I'd like to, and I cant include the "file_to_download" reference inside javascript because its encrypted and I dont have full control of it

    I'd really appreciate any help you can give me
    See you later

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    What is in the function refreshPage() ?

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi,

    Is this what you mean?


    Code:
     
    <a href = "#" onclick = "javascript:dLoad()">Blah</a>
     
    <script language = "javascript" type = "text/javascript">
     
    function dLoad()
    {
    location.href = "somefile" // file to download
     
    window.setTimeout("", 60000) // wait 60 seconds
     
    location.reload() //reload the doc (should happen whether download is in progress or not)
    }
    </script>
    Cheers
    Joe
    http://www.Kanotix.com --My OS of choice, the best hardware detection on the planet!-
    http://distrowatch.com -Linux is the future-
    http://www.packetstormsecurity.org -Security Gurus-


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •