Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Check if window...

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert Email Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
T00N Posted - 04 Aug 2006 : 07:44:46
Is there some code that you can use to check if a particular url-window is open already?

If no open that url in a new window,

If yes go to that window.
9   L A T E S T    R E P L I E S    (Newest First)
s.dav Posted - 10 Aug 2006 : 17:21:39
Y ;-)
T00N Posted - 09 Aug 2006 : 17:11:30
Ok thanks,

so if I replace nw.html (as used in this example) with http://www.madebytoon.nl/dev/mp3player.html it should work?
s.dav Posted - 09 Aug 2006 : 13:42:28
ok, then you can include the code in a javascript function like this:

<script language="javascript" type="text/javascript">
<!--

function openWin()
{
var id= "w001";
newWin=window.open('', id);
newLoc = newWin.location.href.split('/');
newLoc = newLoc[newLoc.length-1];
if(newLoc!='nw.html'){
newWin=window.open('nw.html', id, 'resizable,width=1015,height=700');
} else {
newWin.focus();
}
}

//-->
</script>

then you can create an event on an image (choose OnClick, JavaCall and write the name of the function: 'openWin();')
T00N Posted - 08 Aug 2006 : 20:59:40
Simply he says

If you don't have a clue what you're doing (like me) this is proving to be quite difficult.

When I put the above code in a HTML box on the page the popup loads immidiately. I want it to load after someone has clicked an image.
s.dav Posted - 08 Aug 2006 : 19:53:09
Simply use an HTML box ;-)
T00N Posted - 07 Aug 2006 : 23:01:50
I'm such a javascript nono [2 puppy]

I found -what I think can be- a solution on experts-exchange but I'm not sure how to properly use it in DHE

This is the code I've found:

<script>
  var id= "w001";
  newWin=window.open('', id);
  newLoc = newWin.location.href.split('/');
  newLoc = newLoc[newLoc.length-1];
  if(newLoc!='nw.html'){
   newWin=window.open('nw.html', id, 'resizable,width=1015,height=700');
  } else {
   newWin.focus();
  }

</script>


I have this hotspot on my site that I want to open a window with a music-player on it. This code should make sure that if that particular window is already open it won't reload. But... how and where can I insert this code?
s.dav Posted - 04 Aug 2006 : 13:40:36
no it will not reload the page.

In order to reload the page you have to write

myWin.document.location.reload(true);
T00N Posted - 04 Aug 2006 : 13:35:06
And if the window exist, will it reload the content or not?

So, if there's a music player playing a song will it start over again or not?

Thanks already!
s.dav Posted - 04 Aug 2006 : 08:53:33
You can check if a particular window exists but you cannot see if some browser windows have a particular URL.

Just save the window pointer using a code like this:

var myWin=window.open("myurl")

then you can check using this code if the window exists

if (myWin) {
//do something
}

or

if (myWin.document.location=="myurl") {
// do something
}

so the best method is by combining the two like:

if (myWin) {
if (myWin.document.location=="myurl") {
// do something
}
}


then you can focus the window using (I'm not sure but it's a thing like this)

myWin.focus();

or

myWin.document.focus();

Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000