swebs 0 Newbie Poster

background:
I have a computer with 2 monitors. One monitor opens a web page to an inventory manager(M1). The other monitor has a web page with a display of available inventory(M2).

When I update something on M1 and the page reloads I want it to automatically refresh M2. Currently I just have a timer running on M2 that refreshes the page every 60 seconds. It would be better if it only refreshed when needed.

The base code is all in PHP. The web page that opens for M2 I'm just using a target="inv".

I've tried a bunch of variations of javascript but can't get M2 to refresh when M1 reloads.

I was thinking the easier way to do this would be:
1. Check to see if the M2 window is open. I can open it with the same name every time.
2. If the M2 window is open make it redirect to show.php

I just don't know javascript enough to do this.

Thanks in advance for any help.