Using OpenCart how would I show a categories products as content loaded via AJAX from a MySQL databa开发者_JAVA百科se? This content would be then shown inside a <div>
Fire up MooTools or jQuery and use their AJAX support. Put an onclick
handler on each category link, which calls a function that fetches the category data from the server. It can be raw html, which you then replace the contents of that with.
The server-side script would generate JUST the html necessary to display the product info. Since you'll be inserting it into a div inside an existent page, there's no need for headers/footers, just the core product data.
精彩评论