Click to See Complete Forum and Search --> : Pop-up source code problem


FlyerNL
06-25-2003, 10:42 AM
Hello,

I have a problem with my source code.

Between my "HEAD" i have the following source code:

<a href="#" onclick="mywindow=openIT('http://www.xxx.xxx/xxx.html,600,400,null,null,'mywindowname')">Open het ' chromeless window '</a>

The problem is that I want this pop-up to show up automaticly
and that people don't need to click first.

I don't know how to change this code so it will pop-up correctly. On the internet there are all kind of source codes
to pop-up, but they doens't look like this one.

Any idea?

kind regards,
FlyerNL

Khalid Ali
06-25-2003, 01:08 PM
Just wondering why would you have anchor tag in between head tags..it should be between body tag...
to anwer your question you will need to put some code in the body tags onload event for this to work as you intend.

FlyerNL
06-25-2003, 02:11 PM
<html>
<head>
<script language="javascript" type="text/javascript" src="chromeless.js"></script>
<script language="javascript" type="text/javascript">
function openIT(u,W,H,X,Y,n,b,x,m,r) {
var cU ='close_up.gif' // afbeelding voor het sluiten van het venster
var cO ='close_ovr.gif' // idem, bij muisover
var cL ='clock.gif'
var mU ='min_up.gif'
var mO ='min_ovr.gif'
var xU ='max_up.gif'
var xO ='max_ovr.gif'
var rU ='res_up.gif'
var rO ='res_ovr.gif'
var tH ='<font face=verdana size=1 color=silver>AtcBox.com :: Fly-Inn</font>'
var tW =' Test '
var wB ='#000000' // randkleur
var wBs ='#003366' // randkleur bij het verplaatsen van het venster
var wBG ='#003366' // achtergrondkleur titelbalk
var wBGs='#000000' // achtergrondkleur titelbalk bij het verplaatsen
var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'
var fSO ='scrolling=no noresize'
var brd =b||0; // rand rond het venster
var max =x||false; // maximaliseren: false indien niet gewenst
var min =m||false; // minimaliseren: true indien gewenst
var res =r||true;
var tsz =18; // hoogte titelbalk
return chromeless(u,n,W,H,X,Y,cU,cO,cL,mU,mO,xU,xO,rU,rO,
tH,tW,wB,wBs,wBG,wBGs,wNS,fSO,brd,max,min,res,tsz)
}
</script>
</head>
<body>
<a href="#" onclick="mywindow=openIT('http://www.xxx.xxx/xxx.htm',600,400,null,null,'mywindowname')">Open het ' chromeless window '</a>
</body>
</html>

Above is the complete code...
It works good, but I want the pop-up to automaticly appear
and that people have to click first. Is this possible?

Regards,
FlyerNL

David Harrison
06-25-2003, 04:59 PM
if you want it to open the pop-up window automatically, use this:

<body onload="mywindow=openIT('http://www.xxx.xxx/xxx.htm',600,400,null,null,'mywindowname')">

When the main page has finished loading it'll open the new window.