Ive been all over the net getting nuggets of info but im still sketchy so I caved and logged in here to ask for something specific ... so here goes :
I have a music player that pops up into a sized window that comes into focus when a user clicks anywhere on the "listen" html link (pop up window refreshes / or opens up and comes into focus, nice and simple.)
The player in this pop up has 3 different playlists, so theres 3 different types of content loading into this one pop up depending on the html link.
Im trying to avoid the same playlist / same content loading over and over / keep & refreshing if a user clicks a link that opens it (and its already open, which would interupt music playing.
I need :
When a link is clicked to open the pop up it:
A: Checks its open (if not simply open and bring into focus)
B: If it is open, check whats the content ... "if" the content = what its already trying to open in this pop up - dont refresh, simply bring into focus. IE: do nothing as its already open & content is the same so bring into focus only.
C: If it is already open and the content is not whats its trying to open in that popup, go ahead and load it in and bring into focus.
I get lost as I can only see you check via the window name, but, in my example thats not enough. I need an identifier more than just the window name. So whats happening in "B" is in some way checking the window name + a variable that identifies its either 1 of 3 types of content.
So if it = itself just bring window into focus nothing more, if it doesnt = itself then load and bring to focus, if window is closed load and bring to focus.
I want it all in 1 popup because its a music player and multiple pop ups would be very messy.
Can this be done? Can somebody give me pointer / script examples of this working?
So far I have this function on my site:
winContent = window.open(newContent, 'player', 'right=0,top=20,width=340,height=260,scrollbars=no')
(set=2 is a variable to ask the player to load playlist 2 / 1 / or 3 as I have 3 playlist).
Thanks in advance to anyone who can point me in the right direction .