a标签的href属性长度限制
最近在前端使用JS处理数据然后保存成Excel表格,发现数据量太大时,a标签的href属性就不会生效。(通过a标签的download属性和href属性实现下载)
然后google了一下,
第一个回答:
Is there a way to get around the limit?
Very hardly.It is even probable that the limitations vary from browser to browser, or from E-Mail client to E-Mail client.
I would rather use a HTML form and a server-side script to send the message.
第二个回答
Yes, there is a limit on the length of the URL.
The limit varies from browser to browser, so you should keep the URL below 2000 characters to be safe.
Internet Explorer seems to be the browser that is having the shortest limit. According to this article it’s 2083 characters.
不同浏览器对于a标签的href属性的长度限制不一样,IE浏览器是最短的。
所以如果采用这种方式实现下载的话,需要注意这样的问题。