Javascript link question

Discussion in 'JavaScript' started by paxis, Jul 28, 2008.

  1. #1
    Alright, so I have thepage.php which contains the following code:

    <a href="#" onclick="$('app').hide(); $('controls').show(); return false;">click here</a>
    Code (markup):
    When I click on that it hides the text displaying on that page and then pulls up a form for me to modify the text.

    My question is: if I want to put that link on anotherpage.php so that it will go to thepage.php and run that onclick command, how can I do it?
     
    paxis, Jul 28, 2008 IP
  2. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    Provide more code. Not able to get your point.
     
    VishalVasani, Jul 28, 2008 IP
  3. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If I understand correctly, you want the same thing to happen on anotherpage.php, but automatically?
    You can do that by creating a link like
    <a href='anotherpage.php?app=app&controls=controls'>link</a>
    Code (markup):
    and in anotherpage.php you call your javascript functions like that:
    window.onload = function()
    {
      <?=$_GET['app']?>.hide();
      <?=$_GET['controls']?>.show();
    }
    Code (markup):
     
    xlcho, Jul 29, 2008 IP