我正在使用一些 facebook 帖子来墙 JS,帖子的信息通过 php 回显,但我在控制台中收到此错误:
SyntaxError: unterminated string literal
description: 'Well, personal favorite in the following order.<br />
这是 API 调用的行
description: '<?php echo $info['definition'] ?>'
这是 SQL 数据库中的 $info['definition'] 字符串:
Well, personal favorite in the following order.
1. A stalkers dream come true
2. The reason most work are never done on time.
See what I mean with the examples.
如果我使用其他字符串并直接输入,它不会提示脚本错误,我如何转义字符串并使其在 API 调用中工作?