Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden href ... can it be launched from js?

Status
Not open for further replies.

BJZeak

Programmer
May 3, 2008
230
0
16
CA
I have built a fairly simple AJAX/JS/PHP site.

It has 3 dynamic list boxes that in the end create a <table> in an IFRAME.

The last field/column in the table has a partno that I would like to have as an href so the user just clicks on this and a new html page will pop up in the IFRAME.

I was expecting I could use an href to point to a js script function that would launch the actual HTML address.

PHP code
$chLink = "<a href=";
$chLink .= "fnLoadPart('"; // function hides the url
$chLink .= $rowCol[Part_No];
$chLink .= "')>";
$chLink .= $rowCol[Part_No]; // User see the Part No
$chLink .= "</a>";

JS code

function fnLoadPart(strPartNo)
{
var strHtml;
strHtml = "HTPP://someaddress.com?" + strPartNo;

??? but how do I launch strHtml from the JS script ???

}
 
1. I'd use the onClick event of the link./

2. use window.open to open a new window with the url in question.

Code:
window.open(strHtml,'mynewWindow');


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top