Execute a JavaScript with PHP??

Discussion in 'OT Technology' started by LEGbEND, Aug 17, 2004.

  1. LEGbEND

    LEGbEND .

    Joined:
    Jun 26, 2001
    Messages:
    23,274
    Likes Received:
    6
    Location:
    Shitcago
    I've been on Google for over an hour looking for this...

    I have a PHP case statement. I want it to run a certain JS function ( called slideEm('glideDiv0') ) when a case is set/activated/whatever...

    so itd be:
    switch($doc)
    {
    case "education":

    echo "education";

    slideEm('glideDiv0');

    break;
    }

    or something like that... possible?
     
  2. schmack

    schmack Professional Lurker OT Supporter

    Joined:
    Mar 12, 2003
    Messages:
    1,697
    Likes Received:
    29
    Wouldn't you need to write the javascript to the page?

    switch($doc){
    case "education":
    echo "education";
    echo "<script>slideEm('glidDiv0')</script>";
    break;
    }
     
  3. LEGbEND

    LEGbEND .

    Joined:
    Jun 26, 2001
    Messages:
    23,274
    Likes Received:
    6
    Location:
    Shitcago
    :dunno: i'll try it...
     
  4. LEGbEND

    LEGbEND .

    Joined:
    Jun 26, 2001
    Messages:
    23,274
    Likes Received:
    6
    Location:
    Shitcago
    didnt really work... but i think it's my fault now... :hs:
     
  5. Joe_Cool

    Joe_Cool Moderator

    Joined:
    Jun 30, 2003
    Messages:
    301,196
    Likes Received:
    1,189
    Can your switch statement be moved to client side? Like maybe a drop down list or a set of radio buttons, each option having an "onclick" method?
     
  6. LET ME SMELL YOUR DICK

    LET ME SMELL YOUR DICK OT Supporter

    Joined:
    Aug 6, 2010
    Messages:
    2,321
    Likes Received:
    320
    @Joe_Cool lol y u bump this thread that's 12+ years old?
     
  7. Joe_Cool

    Joe_Cool Moderator

    Joined:
    Jun 30, 2003
    Messages:
    301,196
    Likes Received:
    1,189
  8. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,551
    Likes Received:
    84
    Location:
    Sparkopolis
  9. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,998
    Likes Received:
    35
    Location:
    Los Angeles
    Is that how people were writing code 12 years ago? :mamoru:
     

Share This Page