[Pro] target iframe

I have an Iframe at

Each speakers biog loads into the iframe just fine. How do I get a link from another page on the site to load this speakers page with the selected biog visible? e.g. Stephen Danner is mentioned elsewhere in the site. I want his name to link to this page with his biog visible.

Merci bien

Mike


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You’re going to need some code for this, either JavaScript or PHP (or
another server scripting language). Basically, when you link to a page
containing an iframe (or a standard frame) the only content that will
be loaded into that iframe is whatever the src attribute is as defined
in the HTML of the page. Using JavaScript, you can update that
attribute on the fly when the page loads. Apply Protaculous to the
page, and paste the following into the top Function Body editor:

var iframe = $$('iframe').first();
if(iframe && window.location.hash.length > 4){
	var newSrc = window.location.hash.split('#')[1];
	iframe.writeAttribute('src',newSrc);
}

This means that you then have to add the desired frame source to your
links into the iframe page; so if you want to load bar.html into
foo.html, where foo.html normally loads baz.html in its iframe, you
would manually enter your URL to foo.html as follows:

foo.html#bar.html

I haven’t tested this, and I’m pretty sure there are reserved
characters that you can’t use in the hash portion of a URL (slashes,
for example) so this would only work on a very small universe of pages
and site constructions unless you encoded those characters with % code
escapes. A forward slash is %2F for example.[1]

Walter

  1. URL Encoding

On Feb 7, 2011, at 7:48 AM, Mike Sibthorp wrote:

I have an Iframe at
PLG » Europe Portal
Each speakers biog loads into the iframe just fine. How do I get a
link from another page on the site to load this speakers page with
the selected biog visible? e.g. Stephen Danner is mentioned
elsewhere in the site. I want his name to link to this page with his
biog visible.

Merci bien

Mike


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Genius! Works a charm, at least in Safari.

Many thanks

Mike


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options