Javascript link question

Status
Not open for further replies.

-Matt-

Chronic Crypto
Mar 17, 2008
3,436
70
0
Alright, so I have thepage.php which contains the following code:

Code:
<a href="#" onclick="$('app').hide(); $('controls').show(); return false;">click here</a>

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?
 


do someth like this:

in anotherpage.php
Code:
<a href="thepage.php?theclick=true">go to the page with the click</a>

in thepage.php:
in your body tag do this
Code:
<body onload="<?php if(isset($_GET['theclick'])) echo "$('app').hide(); $('controls').show(); return false;" ?>">

hope that helps.
 
  • Like
Reactions: -Matt-
do someth like this:

in anotherpage.php
Code:
<a href="thepage.php?theclick=true">go to the page with the click</a>
in thepage.php:
in your body tag do this
Code:
<body onload="<?php if(isset($_GET['theclick'])) echo "$('app').hide(); $('controls').show(); return false;" ?>">
hope that helps.

That worked perfectly - Thanks!
 
Status
Not open for further replies.