URI encoding in Yahoo mail compose link

前端 未结 4 1821
南旧
南旧 2020-12-19 16:23

I have link generating web app. I\'d like to make it easy for users to email the links they create to others using gmail, yahoo mail, etc. Yahoo mail has a particular quirk

4条回答
  •  失恋的感觉
    2020-12-19 16:43

    Here is how i do it:

    1. run a window.escape on those chars: & ' " # > < \

    2. run a encodeURIComponent on the full string

    it works for most of my case. though newline (\n) is still an issue, but I replace \n with space in my case and it worked fine.

提交回复
热议问题