1

我有 javascript api 来发送电子邮件,我也可以在其中使用 html,所以我在其中创建表格,但它不工作并且表格不显示。这是我的代码:

<script>
    $(document).ready(function(){
        $("#commandEmail1").click(function() {
            presenter.command("emailSend",{
                "toEmail": "imran.hussain@celeritas-solutions.com",
                "toName": "Celeritas",
                "subject": "email test",
                "body": "Single Attachment",
                "bodyHtml":"<table width="200" border="1"><tr><td>&nbsp;</td><td>&nbsp;</td> </tr><tr> <td>&nbsp;</td><td>&nbsp;</td> </tr></table>",
                 "attachments": [""]
            });
            return false;
        });
    })
</script>
4

2 回答 2

1

在双引号内使用单引号

"<table width='200'...

或者您可以将其中的双引号替换为&quot;

于 2013-04-20T04:58:04.503 回答
0

代码应该是这样的..您使用了双引号..

$(document).ready(function(){


$("#commandEmail1").click(function() {


presenter.command("emailSend",{
    "toEmail": "imran.hussain@celeritas-solutions.com",
    "toName": "Celeritas",
    "subject": "email test",
    "body": "Single Attachment",


 "bodyHtml":"<table width='200' border='1'><tr><td>&nbsp;</td><td>&nbsp;</td> </tr><tr> <td>&nbsp;</td><td>&nbsp;</td> </tr></table>
              ",
       "attachments": [""]
         });
     return false;
         });
         })
于 2013-04-20T05:01:55.570 回答