#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Atlanta, GA
    Posts
    269
    Rep Power
    14

    calling javascript in php????


    Is there any way you can call a javascript function in PHP???

    I am not too familiar with javascript, but I have an expandable menu, that will collapse once the user moves to the next page.

    The list is expanded and collapsed using javascript.

    I can check to see what "page" the user is on by checking the PHP variable in the url,.....BUT, then I need to call the javascript that expands the list.

    Any help would be greatly appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Canada, Toronto
    Posts
    103
    Rep Power
    15
    <script>jsFunctionOpenMenu('<?= $menuItem ?>')</script>
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Location
    UK
    Posts
    527
    Rep Power
    14
    you'll have tp get php to print a javascript function call at the end of your page..


    eg

    if($somecondition){

    echo"<script language='javascript'>";
    echo"mtfunction();";
    echo "</script>";

    }

    pass $somecontion=true;
    from the previous page.
    Doc MacGurgles Babylonian Lizard Tooth Oil worked for me

IMN logo majestic logo threadwatch logo seochat tools logo