PDA

View Full Version : calling a javascript in the body tag


chriskq
05-03-2006, 12:00 PM
having trouble figuring out why my pop up isnt loading on my index page in the body tag
This is calling the js:
<script src="common/scripts/player.js" type="text/javascript"></script>

i've tried calling player(); in the body tag but no go?
also onload="player()"; (all combinations)

This is the js:
function newWindow(myUrl,w,h,features) {
var settings = "";
if (screen.width) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
} else {
winl = 0;
wint = 0;
}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl;
if (features != "") settings += ',' + features;
myWin = window.open(myUrl,"myWin",settings);
myWin.window.focus();
return myWin;
}

function player() {
var myWin = newWindow("player.html", 300, 320, "resizable=yes,scrollbars=no,toolbar=no,menubar=no, location=no,statusbar=no");
}


im doing somthing wrong.. i kno it... think ive been on the puter for too long. Speedy reply pls anyone ?