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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.