Embedding Javascript into PHP/HTML
Posted: Mon Feb 28, 2005 10:10 am
Hi All,
I am trying to write a basic function which just uses a while loop to display a table with data returned from a select statement.
One of the columns contains a string which I want as a hyperlink. This is not a problem in itself, but I want the hyperlink to produce a pop-up.
Unfortunately it doesn't seem possible to incorporate the:
onclick="function('url?id='.$variable['name'].' ');"
into the hyperlink because there are too many apostrophes/speech marks. I also can't create this as a variable external to the function as it won't pick up the correct variable in the hyperlink.
Does anyone have a working example that I can look at, or does anyone have any advice they can give me?
Many thanks,
I am trying to write a basic function which just uses a while loop to display a table with data returned from a select statement.
One of the columns contains a string which I want as a hyperlink. This is not a problem in itself, but I want the hyperlink to produce a pop-up.
Unfortunately it doesn't seem possible to incorporate the:
onclick="function('url?id='.$variable['name'].' ');"
into the hyperlink because there are too many apostrophes/speech marks. I also can't create this as a variable external to the function as it won't pick up the correct variable in the hyperlink.
Does anyone have a working example that I can look at, or does anyone have any advice they can give me?
Many thanks,