使用php echo时未终止的字符串文字

时间:2014-04-29 07:52:07

标签: javascript jquery

我正在使用jQuery来生成一些来自我的数据库的文本。

但是我一直收到jQuery错误:

unterminated string literal

我的原始格式代码如下:

                            + "<div class='operator-details'>"
                            + "<strong>Operator:</strong> Stuart"
                            + "<br />"
                            + "<br /><strong>Phone:</strong> 01"
                            + "<br />"
                            + "<br /><strong>Contact:</strong> <a href='#'>x@x.com</a>"
                                                        + "</div>"
                                                        + "<div class='featured-venue'>"
                            + "<p>Great venue to vistIt is a pleasure to feature it.</p>"
                            + "</div>"

jQuery代码是:

+ "<div class='operator-details'>"
                            + "<strong>Operator:</strong> <?php echo $venue->user_firstname; ?> <?php echo $venue->user_surname; ?>"
                            + "<br />"
                            + "<br /><strong>Phone:</strong> <?php echo $venue->user_telephone; ?>"
                            + "<br />"
                            + "<br /><strong>Contact:</strong> <a href='mailto:<?php echo $venue->user_email; ?>'><?php echo $venue->user_email; ?></a>"
                            <?php if($venue->venue_website) { ?>
                                + "<br />"
                                + "<br /><strong>Website:</strong> <a href='<?php echo $venue->venue_website; ?>' target='_blank'><?php echo $venue->venue_website; ?></a>"
                            <?php } ?>
                        + "</div>"
                        <?php if($venue->venue_featured == 'Yes') { ?>
                            + "<div class='featured-venue'>"
                            +   "<p><?php echo strip_tags($venue->venue_featured_text); ?></p>"
                            + "</div>"
                        <?php } ?>

我有什么方法可以纠正这个错误吗?

由于

0 个答案:

没有答案