2

I'm trying to use a download link in an input type="button" that has an apostrophe, but it doesn't work the ways I've tryed and I can not use %27 in all links.

Eg:

<input value="Download" type="button" onclick='this.disabled=true;location.href="http://example/download/Don't.zip"; this.value="Starting.."'>

How can I make this works? Is that possible to also avoid this trouble if the download link has double quote (")? I need a solution that modifies the code itself instead of the link.

Henrique Barcelos
  • 451
  • 1
  • 4
  • 15

1 Answers1

2

You will need to encode the apostrophe for a URL, not HTML.

Take a look at this table: http://www.w3schools.com/tags/ref_urlencode.asp

You'll see an apostrophe is %27 and a double quote is %22, so your URL would be:

http://example/download/Don%27t.zip
Steve
  • 9,335
  • 10
  • 49
  • 81