Javascript - Open and configure new browser

Status
Not open for further replies.

wheres me jumpa

New Member
Howdo,

I want a link on a page that opens a new browser window, stripped of toolbars and the likes. Ive found plenty of examples to work from but I cant seem to get it working. Heres what I have:

Code:
<A HREF=\"javascript:void(0)\" onClick=\"window.open('player.php?action=bb&type=pls','Player','width=325,height=330, status=yes, directories=no, toolbar=yes, location=no, menubar=no,scrollbars=no, resizable=no');\" >Click</A>

Any help appreciated,

Jumpa
 

louie

New Member
try this function:
Code:
<script language="javascript"> 
   function PopupPic() { 
     window.open( "yourpagehere.html", "",  
     "resizable=1,scrollbars=1,width=200,height=200,left = 50,top = 50"); 
   } 
</script>

and to call it use:
Code:
echo "<a href=\"javascript:PopupPic()\">Click</a>";
 

louie

New Member
if you need to pass dynamic id's change the function to:

Code:
function PopupPic(your_var){
 window.open( "yourpagehere.php?id="+your_var, "",  
     "resizable=1,scrollbars=1,width=200,height=200,left = 50,top = 50"); 
}

then call it like this:
Code:
echo "<a href=\"javascript:PopupPic($your_id_here)\">Click</a>";
 
Status
Not open for further replies.
Top