Click link in embeded Object trigger parent window reload?

M

Mark Anderson

Hi. I've had to turn an IFrame-embedded page into a an Object using the
data attribute to hold the page to meet XHTML STRICT validation. The
<object>'s embedded page is a query URL returning a basic HTML page to
hold an <a> link enclosing a thumbnail of a latest added record in a
picture database. So far, so good.

What I need is that clicking the embedded image/link causes the parent
page to load a new URL. What syntax do I use to refer to the 'parent'
page rather than the page actually containing the <a> link.

Actually I could probably us the thumbnail <img>'s onclick event rather
than an enclosing <a> link but the same syntax problem arises. Sorry, no
URL to show as the page in on an intranet (which is also the eventual
deployment scenario - with a mind to security issues, etc.)

TIA

Mark
 
D

d d

Mark said:
Hi. I've had to turn an IFrame-embedded page into a an Object using the
data attribute to hold the page to meet XHTML STRICT validation. The
<object>'s embedded page is a query URL returning a basic HTML page to
hold an <a> link enclosing a thumbnail of a latest added record in a
picture database. So far, so good.

What I need is that clicking the embedded image/link causes the parent
page to load a new URL. What syntax do I use to refer to the 'parent'
page rather than the page actually containing the <a> link.

Actually I could probably us the thumbnail <img>'s onclick event rather
than an enclosing <a> link but the same syntax problem arises. Sorry, no
URL to show as the page in on an intranet (which is also the eventual
deployment scenario - with a mind to security issues, etc.)
TIA
Mark

Is this what you're looking for ?

onclick="parent.location.href='http://example.com';"

~dd
 
M

Mark Anderson

d d said:
Is this what you're looking for ?

onclick="parent.location.href='http://example.com';"

~dd

Thanks. Having started out from a context of frames/iframes I'd headed
down quite the wrong path.

However, it's not quite the solution - it works in Safari & Firefox but
IE (v6) loads the called page into the clicked <object>. Is this an IE
bug or is some conditional syntax needed for different UAs?

Mark
 
D

d d

Mark said:
Thanks. Having started out from a context of
frames/iframes I'd headed down quite the wrong path.
However, it's not quite the solution - it works in Safari & Firefox but
IE (v6) loads the called page into the clicked <object>. Is this an IE
bug or is some conditional syntax needed for different UAs?
Mark

Hard to comment without seeing the code, but maybe
try using top.location.href instead.

~dd
 
M

Mark Anderson

d d said:
Hard to comment without seeing the code, but maybe
try using top.location.href instead.

~dd

Understood, here's a test page I've made it as simple as possible so as
to try and avoid side issues. I've added the onclick to the image in
the 'embedded' page. Code is validating XHTML 1.0 Strict.

Both top.location and parent.location work in Safari(v2), Firefox(v2
Mac/Win). IE6 persists in loading the resulting page back into the
calling object not the parent frame (...and you guessed, the main target
browser is IE <sigh>).

Regards

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top