View Full Version : changing url with <0bject>

10-31-2011, 08:15 PM
I'm trying to change the parent page of site1 when someone clicks on an <object> that is sitting on site2. Not sure how to do this. Onclick doesn't seem to do anything. I would have it go to a function that changes document location, but even alert('test') isn't doing anything. Is it because they're on two different website locations? I have access to both sites, but I have to object or iframe in this item and have it change the url when clicked.

Here's the object tag I have:
<object onclick="alert('test');" id="http://www.website2.com/file.html" data="http://www.website2.com/file.php" type="text/php"></object>

and here's the basic jist of file.php:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <body style="margin:0; padding:0;"><div id=final>


$item = "on_the_cover__thumb1";

$data = mysql_query("SELECT * FROM auth2es WHERE id LIKE '37' AND id2 LIKE '1'");

$row variable. This makes it easier to echo each field.

$link1 = 'http://www.site1.com/page/';

while($row = mysql_fetch_array($data)){
echo '

<a href="'.$link1.'"><img src="' . $row['filepath1'] . '"></a>';



11-01-2011, 12:30 AM
scratch this question... I found the answer using javascript and post.message.