继承我的代码:
<td onclick="openFile('<?php echo htmlentities ($row['name'])?>','
<?php echo htmlentities ($row['content'])?>')">
<a href="#nf" data-toggle="tab"><?php echo $row['name']?></a></td>
Run Code Online (Sandbox Code Playgroud)
因为$ row ['content']中有一个endline char:
openFile('哇','哇哇
哇 ');
当浏览器无法在同一行中找到结尾qoutes时,它会抛出一个
错误(SyntaxError:unterminated string literal [Break On此错误]).
对此有何解决方案?