sc7389x
03-31-2005, 02:10 AM
Ok, I'm just starting out with javascript and I need some help.
When I click a link, it opens up a new window. However, in the taskbar where you see "javascript: view('1') when I click on the first link, I want the number between the parenthesis to appear on the page in the new window. However, if I click the second link which makes a '2' appear in the part with "view()" I want the popped up window to display the 2.
I program PHP and here's what I have so far (mixed in with php.. but I'm using javascript to get the job done in this case.)
echo "<td>";
//subject
echo "
<SCRIPT language=\"JavaScript\">
function view()
{
mywindow = window.open
(\"pm.php?action=view&messageid=the_number_selected_should_go_here_as_well_as_on_the_page\",\"".$row['subject']."\",\"location=1,status=1,scrollbars=0,width=200,height=200\");
mywindow.moveTo(384,200);
}
</script>";
echo "<a href=\"javascript: view('".$row['id']."')\">".$row['subject']."</a>";
echo "</td>";
$row['id'] is the number between the parenthesis (circled in blue. for example: view('1'))
$row['subject'] is the title of the PM (also circled in blue in the attachment)
Any help would be really appreciated. I've been googling this for like 4hrs. I don't even know what to search for. =/
Thanks in advance.
When I click a link, it opens up a new window. However, in the taskbar where you see "javascript: view('1') when I click on the first link, I want the number between the parenthesis to appear on the page in the new window. However, if I click the second link which makes a '2' appear in the part with "view()" I want the popped up window to display the 2.
I program PHP and here's what I have so far (mixed in with php.. but I'm using javascript to get the job done in this case.)
echo "<td>";
//subject
echo "
<SCRIPT language=\"JavaScript\">
function view()
{
mywindow = window.open
(\"pm.php?action=view&messageid=the_number_selected_should_go_here_as_well_as_on_the_page\",\"".$row['subject']."\",\"location=1,status=1,scrollbars=0,width=200,height=200\");
mywindow.moveTo(384,200);
}
</script>";
echo "<a href=\"javascript: view('".$row['id']."')\">".$row['subject']."</a>";
echo "</td>";
$row['id'] is the number between the parenthesis (circled in blue. for example: view('1'))
$row['subject'] is the title of the PM (also circled in blue in the attachment)
Any help would be really appreciated. I've been googling this for like 4hrs. I don't even know what to search for. =/
Thanks in advance.