Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[JS] Popup help

Banned
Banned
Joined
Dec 27, 2004
Messages
108
Reaction score
0
Hello, I'm using this JS system located at
http://forum.ragezone.com/showthread.php?t=293139

But when I click on any link on the JS window I want it to open in a new tab or window. Does anyone know how I can do this? my page should open in a new window. I set the HTML site up so it will open in a diff window but when its in the JS window it opens in the JS window.

Site


vote page
 
Banned
Banned
Joined
Dec 27, 2004
Messages
108
Reaction score
0
I look off the links on the js html site for now, any help would be great.
 
Joined
Jun 8, 2007
Messages
1,985
Reaction score
490
The javascript popup thing you're trying to use is overcomplicating matters too much..

A pop-up is pretty simple, here's some code to have a popup with any information you'd want to put on it:

Put this in the header:
Code:
<script language="JavaScript" type="text/javascript">
      var popUpWin=0;
      function popUpWindow(URLStr, left, top, width, height)
      {
      if(popUpWin)
      {
      if(!popUpWin.closed) popUpWin.close();
      }
      popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  }
  
      </script>

Put this where you want the link:
Code:
<a href="#" onclick="javascript:popUpWindow('HTTP://YOURDOMAINHERE.COM','200','200','350','350')"><img src="http://www.avsbest.com/images/message.PNG" alt="Add to Friends" border='0' /> Link Text </a>

Obviously, change the YOURDOMAINHERE.COM to your targetted URL and Link Text to your desired textlink.

This code will open a popup at x=200, y=200, width=350, height=350.

You can change these numbers to edit this: ,'200','200','350','350'

I might have gotten this off someone at ragezone, or just an HTML/JS help site.. But it works. I can't remember who to give credits to, but it's a pretty relativly common script.
 
Banned
Banned
Joined
Dec 27, 2004
Messages
108
Reaction score
0
The javascript popup thing you're trying to use is overcomplicating matters too much..

A pop-up is pretty simple, here's some code to have a popup with any information you'd want to put on it:

Put this in the header:
Code:
<script language="JavaScript" type="text/javascript">
      var popUpWin=0;
      function popUpWindow(URLStr, left, top, width, height)
      {
      if(popUpWin)
      {
      if(!popUpWin.closed) popUpWin.close();
      }
      popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  }
  
      </script>

Put this where you want the link:
Code:
<a href="#" onclick="javascript:popUpWindow('HTTP://YOURDOMAINHERE.COM','200','200','350','350')"><img src="http://www.avsbest.com/images/message.PNG" alt="Add to Friends" border='0' /> Link Text </a>

Obviously, change the YOURDOMAINHERE.COM to your targetted URL and Link Text to your desired textlink.

This code will open a popup at x=200, y=200, width=350, height=350.

You can change these numbers to edit this: ,'200','200','350','350'

I might have gotten this off someone at ragezone, or just an HTML/JS help site.. But it works. I can't remember who to give credits to, but it's a pretty relativly common script.

Thanks a bunch.
 
Back
Top