Link to home
Start Free TrialLog in
Avatar of roscoeh23
roscoeh23

asked on

opening a javascript link in php

This is what I have so far the syntax is wrong and I can't seem to get it. I want  it to open 400px by 300px.


$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="javascript:window.open("news/readnews.php?ID='.$row['ID'].'")" title="Read the full article with complete formatting" target="_blank"">Full Article</a>'."\n";
Avatar of babuno5
babuno5
Flag of India image

try this out
$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="javascript:window.open(\'news/readnews.php?ID="'.$row['ID'].'"\')" title="Read the full article with complete formatting" target="_blank"">Full Article</a>'."\n";
sorry missed a double quote
$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="javascript:window.open(\'news/readnews.php?ID="'.$row['ID'].'"\')" title="Read the full article with complete formatting" target="_blank">Full Article</a>'."\n";
Avatar of roscoeh23
roscoeh23

ASKER

It does not work it just opens this..

javascript:window.open('news/readnews.php?ID=

it just cuts off where the php value should be
$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="javascript:window.open(\'news/readnews.php?ID='.$row['ID'].'\')" title="Read the full article with complete formatting" target="_blank">Full Article</a>'."\n";
Defining height and width of the window

$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="javascript:window.open(\'news/readnews.php?ID='.$row['ID'].'\',\'mywindow\',\'width=400,height=300\')" title="Read the full article with complete formatting" target="_blank">Full Article</a>'."\n";
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial