Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / June 2007



Tip: Looking for answers? Try searching our database.

Click link in embeded Object trigger parent window reload?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Anderson - 28 Jun 2007 23:35 GMT
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 - 29 Jun 2007 00:01 GMT
> 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
[quoted text clipped - 12 lines]
> TIA
> Mark

Is this what you're looking for ?

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

~dd
Mark Anderson - 29 Jun 2007 09:07 GMT
> 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 - 29 Jun 2007 10:53 GMT
> "d d" <no_spam@please.net> wrote in message
>> Is this what you're looking for ?
[quoted text clipped - 5 lines]
> 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
Mark Anderson - 29 Jun 2007 15:10 GMT
>> "d d" <no_spam@please.net> wrote in message
>>> Is this what you're looking for ?
[quoted text clipped - 10 lines]
>
> ~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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.