0

hi all,
i have a problem here using ajax the problem is i displayed catagories dynamically in my index page and i want to display products under the catagory which users select using ajax
my problem is how to get the category element id`s which are generated dynamically.
iam thinking of getting it from url i.e when i click category i will pass element id in url so, i want to catch it and display products under that id using ajax
any other ideas?
thank u

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by SoniaBaby
0

I assume that each category will have a link. You can use this link to call your ajax page, eg:

<?php echo '<a href="javascript:{}" onclick="ajaxLoad(' . $cat_id . ', \'ajax_content.php\')">Category</a>';

Your ajax function will need to catch the $cat_id and page to load (at a minimum).


SoniaBaby

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.