views:

39

answers:

2

Hi,

I am working on a shopping cart(open cart) software and have this question. I am not familiar with mvc framework. What i want to know how to show content(mysql) inside a div when you click on a link. There will be 8-10 links and clicking on each should fetch its corresponding products. So for example

category 1 | category 2 | category 3

show [products from category 1] when clicked on "category 1" and same way for the other two. the problem is the url for each link will have the category id so when clicked it will fetch its own products inside this div. Can someone please guide me with an example available online?

looking for some thing that can dynamically fetch contents from mysql inside this div. content change is based on the category id in the url of the links I am clicking on.

regards

A: 

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.

Marc B
A: 

Hi,

thanks for the reply. I get your logic but can you please send me a link where I can learn about this jquery on-click event to load content from the url inside a div or something similar to the above scenario. I am new to jquery and couldn't find good examples to learn about this.

thanks.

jay