Solved

opening a javascript link in php

Posted on 2006-11-09
6
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
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 …

726 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