Get answers to millions of questions and give back by sharing your knowledge with others. Sign up for an account. Close Sign up. Do you need your password? Submit your solution!
When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome. Don't tell someone to read the manual.
Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid. Related Questions. This will trigger any "onbeforeunload" events even though the page won't actually unload unless the target href doesn't actually trigger a download. This does still work for same origin downloads as well — apokryfos. Add a comment.
Barkermn01 Barkermn01 6, 31 31 silver badges 76 76 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? But I cannot use window.
If you are using jQuery , you could take advantage of it to produce a smaller snippet Something like this will give similar results as afree 's snippet:.
The download attribute works only where href is set, as for with the a tag or the area tag. It indicates that the target will be downloaded when a user clicks on the hyperlink.
0コメント