2013-04-20 37 views
1

我有javascript api發送電子郵件,我也可以使用html,所以我在裏面創建表,但它不工作,表不顯示。這裏是我的代碼:雙引號如何在javascript腳本內創建HTML表

"<table width='200'... 

,或者你可以用裏面代替雙引號內

<script> 
    $(document).ready(function(){ 
     $("#commandEmail1").click(function() { 
      presenter.command("emailSend",{ 
       "toEmail": "[email protected]", 
       "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> 

回答

1

使用單引號&quot;

+0

感謝它爲我工作 – 2013-04-20 05:09:39

0

代碼應該是這樣的.. 您已經使用雙報價..

$(document).ready(function(){ 


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


presenter.command("emailSend",{ 
    "toEmail": "[email protected]", 
    "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; 
     }); 
     }) 
相關問題