Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: php inside javascript  (Read 1481 times)

Vasile Rusnac

  • Newbie
  • *
  • Karma: 7
  • Posts: 49
php inside javascript
« on: December 17, 2007, 11:16:31 pm »

Since I have no knowledge in php my question would sound probably fullish or not serios  ;D anyway, I am risking and asking for your help:

here it is the problem:
I am trying to use a javascript menu which basically shows the categories list (tabbed) and upon moving the mouse over categories links it will show in a div the the articles from that category.

so, instead of "active" class of the li it uses the div id to color the active tab.
This is done by a javascript showing numerically the active id.
Quote
<script type="text/javascript">
//<![CDATA[
.....
cnum = 1;
......
//]]>
</script>

so, the id=1 of the tab will be colored showing it is active.

Unfortunatelly, I can only point the id for the div using one single number. Thus, this is the pace for the php to work, isnt it?
Basically I need the the number 1 or 2 or 3...  from the java script to be generated in accordance to the category id I click.

For ex, if I click the courses/ category (which id is 3 in the sql table) the cnum from the java should also point 3.

Will appreciate any help. Thanks
Logged