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] Making popup

Elite Diviner
Joined
Jan 11, 2008
Messages
405
Reaction score
0
Hey everone im trying to add something into my site like i just dont know where to add them at.

popup code

<script language="JavaScript">
function (){
myleft=(screen.width)?(screen.width-300)/2:100;mytop=(screen.height)?(screen.height-400)/2:100;
settings='top=' + mytop + ',left=' + myleft + ',width=300,height=400,location=no,directories=no, menubar=no,toolbar=no,status=no,scrollbars=no,resi zable=no,fullscreen=no'
Ads=window.open('http://adclick.adster.com/click.php?link_id=10562&napid=25503&napub=23906',' Ads', settings);
Ads.focus();}
</script>

lunch code

<body onload="javascript:Ads()">
But nothing popups? how do i add this
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Jun 28, 2007
Messages
2,986
Reaction score
3
Re: [JS] how to add this popup

Changed title...follow the rules next time.

Place the <script> between the <head> tags, and it should work (with the <body> attribute).

Also, be aware, people dislike popup ads A LOT, I click away websites that have ad popups and mark them as a dumb site via various popular site rating systems.
 
Joined
Jul 26, 2006
Messages
3,627
Reaction score
1,006
Re: [JS] how to add this popup

Also, be aware, people dislike popup ads A LOT, I click away websites that have ad popups and mark them as a dumb site via various popular site rating systems.
I usually mark em red on the Norton wesbite.

/topic
Use
Code:
 tags and try to google first.
I've had numerous problems which I was just about to post.. then I found the solution.
 
Custom Title Activated
Loyal Member
Joined
Feb 27, 2004
Messages
1,376
Reaction score
50
a secret is make the script load before the page ends.. ^^

if u put it on onload.. it will wait for everything before execute.. execute it before onload ^^
 
Elite Diviner
Joined
Jan 11, 2008
Messages
405
Reaction score
0
Grrr cant get the thing to work if someone can help me plz pm me
 
Junior Spellweaver
Joined
Dec 2, 2006
Messages
198
Reaction score
0
i am most certain that you can just google this. just type something like "javascript popup" or even add generator at the end. =]
 
Elite Diviner
Joined
Jan 11, 2008
Messages
405
Reaction score
0
The problem is i dont know how to add it i need like a guid eon adding in popups it only tells me where to but i dont get it lol
 
Junior Spellweaver
Joined
Dec 2, 2006
Messages
198
Reaction score
0
Code:
<!-- TWO STEPS TO INSTALL POPUP WINDOW:

   1.  Paste the first into the HEAD of your HTML document
   2.  Use the code to open the popup page on your site  -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=400');");
}
// End -->
</script>


<!-- STEP TWO: Paste this onLoad event handler into the BODY tag -->

<BODY onLoad="javascript:popUp('http://adclick.adster.com/click.php?link_id=10562&napid=25503&napub=23906')">

<!-- Script Size:  0.73 KB  -->
by
 
Custom Title Activated
Loyal Member
Joined
Jun 28, 2007
Messages
2,986
Reaction score
3
a secret is make the script load before the page ends.. ^^

if u put it on onload.. it will wait for everything before execute.. execute it before onload ^^

JS is only ever executed after the whole site is loaded if I rember correctly...
 
Experienced Elementalist
Joined
Mar 22, 2008
Messages
297
Reaction score
0
Code:
<html>
<head>
<title>My Title</title>

<script language="JavaScript">
function Ads(){
myleft=(screen.width)?(screen.width-300)/2:100;mytop=(screen.height)?(screen.height-400)/2:100;
settings='top=' + mytop + ',left=' + myleft + ',width=300,height=400,location=no,directories=no, menubar=no,toolbar=no,status=no,scrollbars=no,resi zable=no,fullscreen=no'
Ads=window.open('http://adclick.adster.com/click.php?link_id=10562&napid=25503&napub=23906',' Ads', settings);
Ads.focus();}
</script>

</head>

<body onload="javascript:Ads()">

My body, template, text w/e here

</body>

</html>

It's should like this.
 
Back
Top