popcop
05-13-2005, 07:30 PM
I want to use javascript to open a popup window with news which is pulled from the database by PHP
this si that javascript...
=================================================
<script language="JavaScript">
<!--
function open_read(inUrl)
{
winLeft = (screen.availWidth-340)/2;
winTop = (screen.availHeight-450)/2;
if (navigator.appName == "Microsoft Internet Explorer") {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=auto,resizable=no,width=340,he ight=450,left="+winLeft+",top="+winTop
} else {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=auto,resizable=no,width=340,he ight=450,screenX="+winLeft+",screenY="+winTop
}
window.open(inUrl, "read", strWindow);
}
//-->
</script>
======================================================
and this is the PHP code im using to for the link
<a href='read.php?id={$data['id']}' target='news');return false;'>{$data['header']}</a>
that piece of code is to open the news page in an iframe called 'news' but how can i change that piece of PHP code so that it links to the javascript and opens in a popup window ????
thanks
this si that javascript...
=================================================
<script language="JavaScript">
<!--
function open_read(inUrl)
{
winLeft = (screen.availWidth-340)/2;
winTop = (screen.availHeight-450)/2;
if (navigator.appName == "Microsoft Internet Explorer") {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=auto,resizable=no,width=340,he ight=450,left="+winLeft+",top="+winTop
} else {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=auto,resizable=no,width=340,he ight=450,screenX="+winLeft+",screenY="+winTop
}
window.open(inUrl, "read", strWindow);
}
//-->
</script>
======================================================
and this is the PHP code im using to for the link
<a href='read.php?id={$data['id']}' target='news');return false;'>{$data['header']}</a>
that piece of code is to open the news page in an iframe called 'news' but how can i change that piece of PHP code so that it links to the javascript and opens in a popup window ????
thanks