私はmailtoとhrefを使用してあらかじめ入力されたメールを送信しようとしていますが、私はすぐにIE9に509文字以上のhrefsを認識することに問題があることを発見しました。基本的に、リンクをクリックすると空白のページが表示されます。私は答えを探して、このjavascriptの解決策に出くわしましたが、それでもまだ仕事はありません。ここでIE9とmailto文字の制限
は、アンカータグである:
<a href="javascript:doMailto()">Sign up</a>
そして、ここではスクリプトです:
var sMailto = "mailto:[email protected]?body=Dear eyecare professional,%0A%0aTo help us schedule your upcoming webinar, please fill out and return the following information:%0A%0A• Name:%0A%0A• Preferred date of webinar* (any Wednesday at 6 pm EST):%0A%0A• City/State (Optional):%0A%0A• Comments/Questions/Feedback:%0A%0AUpon receipt, we will send you a link to an upcoming GoTo Meeting webinar on Macula Risk implementation in your clinic. These webinars are regularly held on Wednesdays at 6 pm EST.%0A%0A* If you would like to request training on any other date or time - please note this in the Comments section and we will do our best to accommodate your request.%0A%0AKind Regards,%0A%0AGerry Bruckheimer";
function doMailto() {
document.location.href= sMailto;
}
奇妙なことは、これは愚かなIE 9
除き、他のすべてのブラウザで動作していることです更新:似たような問題が発生している場合は、window.open(url)を試してみてください。私は完璧な解決策ではないことを認識していますが、それは機能します
私は同じ問題があります。 sMailToの長さに問題があるようです。長さが508文字を超えると失敗します。 – BlackMael
ブックマークレットの長さ制限が508にもなる可能性があります – BlackMael