Jump to content

help with passing js command with php to a parent page


GD77

Recommended Posts

PS - if you just want to run a JS command as soon as the page loads, do this:

<html>
  <head>
    <script type="text/javascript">
      parent.function();
    </script>

 

That will execute before the HTML renders.

 

Actually that is what I ve done:

$msg="Welcome, You Are Logged In.";

sleep(2);

echo "<script type='text/javascript'>parent.boxOFF();</script>";

 

and it s working but now the echo command is preventing the $msg data from showing

echo solved the delay and the $msg problem with this:

 

$msg="Welcome, You Are Logged In.

            <script type='text/javascript'>

function delayed(){parent.boxOFF();parent.location.reload(true);}

    window.setTimeout(delayed,2000);</script>";

 

Don t know if their is a another or better way...

Thanks again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.