最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Displaying a <script> tag in an email - Stack Overflow

programmeradmin0浏览0评论

OK this seems simple enough, but I can't think of a solution. SO to the rescue.

I am trying to add a <script></script> tag to an email, not for the purposes of running the script, but so the user can copy and paste it in their websites. So for example the email might say:

Simply copy the text below and paste it into you webpages where you would like widget to be displayed:

<script src="widget"></script>

The problem is the script text is not displayed in the email. How can I display it as simple text and not have the email client remove it?

Thanks

OK this seems simple enough, but I can't think of a solution. SO to the rescue.

I am trying to add a <script></script> tag to an email, not for the purposes of running the script, but so the user can copy and paste it in their websites. So for example the email might say:

Simply copy the text below and paste it into you webpages where you would like widget to be displayed:

<script src="widget"></script>

The problem is the script text is not displayed in the email. How can I display it as simple text and not have the email client remove it?

Thanks

Share Improve this question asked Oct 24, 2013 at 12:56 superphonicsuperphonic 8,0846 gold badges34 silver badges64 bronze badges 1
  • 2 It might be detecting it as spammy/malicious, or you haven't escaped your start and end tags properly (&lt; and &gt;). – Qantas 94 Heavy Commented Oct 24, 2013 at 12:57
Add a ment  | 

1 Answer 1

Reset to default 7

use &lt; and &gt; for send tags.

just like:

&lt;script src="widget"&gt;
&lt;/script &gt;

output:

<script src="widget">

</script >

发布评论

评论列表(0)

  1. 暂无评论