Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用此代码显示 k2 项目的标题。代码中的单词标题应该被替换以查看其他输出。为了显示 k2 项目的内容,我应该用什么替换?这是我的代码
<script> jQuery (document).ready(function() { $('#itemtest').html('<?php echo $this->item->title;?>'); }); </script>
如果要显示全文,请将其替换为title或introtext。fulltext确保使用addslashesPHP 函数转义引号。
title
introtext
fulltext
addslashes
所以,你应该有这样的东西:
<?php echo addslashes($this->item->introtext);?>