Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

[JS] Popup help

🚫
Exiled
Joined
Dec 27, 2004
Messages
108
Reaction score
0
Location
Oregon
I look off the links on the js html site for now, any help would be great.
 
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.
 
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