jquery - using a function id in a different function

Posted by andrew on Stack Overflow See other posts from Stack Overflow or by andrew
Published on 2010-12-29T00:48:32Z Indexed on 2010/12/29 0:54 UTC
Read the original article Hit count: 155

Filed under:

Hi, I have a function like that:

function loadcategory(id) {
   jQuery("#categoryArea").load("ajax_post_category.php?catid="+id+"");
  }

im getting id via link like that:

<a href='javascript:loadcategory(".$row['catid'].");'>

i would like to use function loadcategory(id)'s id in a different function. for example:

function different() {
       jQuery("#different").load("ajax_post_category.php?catid="+loadcategory(id)+"");
      }

as you can see i wanted to use +loadcategory(id)+, however i havent gotten any values. well, how can i get that value by jquery? i dont know, can anyone tell me the true way?

regards

© Stack Overflow or respective owner

Related posts about jQuery