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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop-Up issue [object Window]

Status
Not open for further replies.

Deltran

Programmer
Mar 29, 2005
10
I'm writing some commenting software (ok, ok, a blog) that's being added to existing software. What they want is for the link to the blog to be attached to files that users have uploaded. The link brings up a pop-up with the comment section inside it.

When the link is selected, the pop-up works (the blog is fine and functions as it should) however the calling window clears itself and displays [object Window] as it's content. The navigation bar's URL is replaced by my javascript:window.open() call.

How do I stop the calling window from doing this?

Code Snippit:

$link = "javascript:window.open('./blog.php?conversation_id=$send_doc_id&table_id=96','Comments','width=900,height=800,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');";
$useMe = display_snippit2_blog($group_id, $table_id, $send_doc_id, $link, &$db);
...
echo $useMe;

function display_snippit2_blog($group_id,$table_id, $conversation_id, $link, &$db)
{
$post_count = 0;

$sql = "SELECT * FROM tableName";
$result = mysql_query($sql);
$post_count = mysql_num_rows($result);
$conversation = mysql_fetch_array($result);

$post_date = ($conversation['post_date']=="")?"0/0/0000":htmlentities($conversation['post_date']);

if($post_count >0){
$returnMe = "
<table width=100%>
<tr><td align=right><font size -2><i>Last post: $post_date</i></font></td></tr>
<tr><td align=right><font size -2><i><a href = \"$link\">$post_count comments</a></i></font></tr></td>
</table>
";
} else
$returnMe = "<a href = \"$link\"><i>no comments</i></a>";

return($returnMe);
}//end function display_snippit2_blog

------------------------------
Thanks you for helping me not be so dumb,
Deltran
 
make the code like this:

Code:
$link = "window.open('./blog.php?conversation_id=$send_doc_id&table_id=96','Comments','width=900,height=800,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');";
Code:
<tr><td align=right><font size -2><i><a href="#" onclick=\"$link; return false;\">$post_count comments</a></i></font></tr></td>

*cLFlaVA
----------------------------
[tt]a frickin' twelve-gauge, what do you think?[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Either that or change your window.open line to this:
Code:
$link = "javascript:[red]void([/red]window.open('./blog.php?conversation_id=$send_doc_id&table_id=96','Comments','width=900,height=800,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes')[red])[/red];";

Adam

Whatever I feel like I wanna do, gosh!
 
deltran said:
Thanks you for helping me not be so dumb,
That's a problem for a different forum.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Thank you, cLFlaVA and adam0101, for your help. That problem's been getting to me :)

chrissie1, thx for the tip ;) Have any recommendations? :)

------------------------------
Thanks you for helping me not be so dumb,
Deltran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top