469,613 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Need to display subcategories based on categories with ajax

Hello,
I have a link navigation of categories retrieved from the database,
while I know how to display subcategories based on category link
clicked with classical approach, I want to do this with ajax,

The problem is with the classical style,I know the GET['id'] sent and
the row im in with the category, so by simple comparison, I know how
to display the subcategories under its parent category, but with ajax,
I cannot know the GET and compare it, so the subcategories are
displaying under a different category

Help appreciated
Jun 27 '08 #1
2 2522
On 3 Jun, 16:19, itpvision <itpvis...@gmail.comwrote:
Hello,
I have a link navigation of categories retrieved from the database,
while I know how to display subcategories based on category link
clicked with classical approach, I want to do this with ajax,

The problem is with the classical style,I know the GET['id'] sent and
the row im in with the category, so by simple comparison, I know how
to display the subcategories under its parent category, but with ajax,
I cannot know the GET and compare it, so the subcategories are
displaying under a different category

Help appreciated
Why should there be any difference between an AJAX request and a
"classical" one? You control the request to the server in both cases.
Jun 27 '08 #2
itpvision wrote:
Hello,
I have a link navigation of categories retrieved from the database,
while I know how to display subcategories based on category link
clicked with classical approach, I want to do this with ajax,

The problem is with the classical style,I know the GET['id'] sent and
the row im in with the category, so by simple comparison, I know how
to display the subcategories under its parent category, but with ajax,
I cannot know the GET and compare it, so the subcategories are
displaying under a different category

Help appreciated
Why not? Have a js function that gets the value of the option which is
the category. Then have the url that it is sent to for php processing
apppend the ?cat=cat_value. Do the AJAX call with that url. In your
php code just do a $_GET['cat'] and you have the category. The do your
lookups and build the return.

Works for me.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sofia | last post: by
2 posts views Thread by Troy Lynch | last post: by
4 posts views Thread by Brian Murphy | last post: by
reply views Thread by Manuel | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.