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.
使用 OpenCart 如何将产品类别显示为通过 AJAX 从 MySQL 数据库加载的内容?然后,此内容将显示在<div>
<div>
启动MooTools或jQuery并使用它们的 AJAX 支持。在每个类别链接上放置一个onclick处理程序,该处理程序调用一个从服务器获取类别数据的函数。它可以是原始 html,然后您可以用它替换它的内容。
onclick
服务器端脚本将只生成显示产品信息所需的 html。由于您会将其插入现有页面内的 div 中,因此不需要页眉/页脚,只需核心产品数据。