如何在跨站点的页面上插入markdown文本?

时间:2016-01-12 12:28:04

标签: javascript jquery ruby-on-rails ajax

我正在使用script标记从其他网站接收降价格式的文字。它适用于在线文本,但如果它带有换行符,我会收到控制台错误。

Uncaught SyntaxError: Unexpected token ILLEGAL

我从服务器获取的文本示例:

var body = "<p>Introductions</p>

<p>Hi! I&#39;m Professor Franklin Risby. Pleased to make your acquaintance. We&#39;ll be spending some time together, as I&#39;m supposed to teach you...</p>

<p>I won&#39;t assume any previous functional programming knowledge....</p>";
      $('script#s_parent').after("<div class='pagemash_parent'></div>");
      $('._parent').html(body);

0 个答案:

没有答案