Solved

opening a javascript link in php

Posted on 2006-11-09
6
225 Views
Last Modified: 2012-05-05
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";
0
Comment
Question by:roscoeh23
  • 4
6 Comments
 
LVL 15

Expert Comment

by:babuno5
ID: 17905963
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";
0
 
LVL 15

Expert Comment

by:babuno5
ID: 17905974
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";
0
 

Author Comment

by:roscoeh23
ID: 17906046
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
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:babuno5
ID: 17906077
$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";
0
 
LVL 15

Expert Comment

by:babuno5
ID: 17906137
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";
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 17906147
If you open a new window via javascript there is no need to give a target. Try:

$strOut .= ' <a id="newsExtra'.$row['ID'].'" class="extra news" href="#" onclick="window.open(\'news/readnews.php?ID='.$row['ID'].'\',\'\',\'width=400,height=300\'); return false" title="Read the full article with complete formatting">Full Article</a>'."\n";
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now