<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Problem with iframe, links, and redirects</title>
	<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects/</link>
	<description>Comments on Ask MetaFilter post Problem with iframe, links, and redirects</description>
	<pubDate>Wed, 19 Sep 2007 10:55:03 -0800</pubDate>
	<lastBuildDate>Wed, 19 Sep 2007 10:55:03 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Problem with iframe, links, and redirects</title>
		<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects</link>	
		<description>I have a problem where I show a document within an iframe, and I wish to have links clicked within the iframe show in the toplevel window instead of the iframe.  But there&apos;s a twist... &lt;br /&gt;&lt;br /&gt; I can&apos;t (easily) modify the documents that are shown within the iframe.&lt;br&gt;
&lt;br&gt;
The problem that comes about is, the target of these links has a bit of javascript that says &quot;Am I in the toplevel window?  No?  Then set the toplevel href to my href&quot;.  This nicely accomplishes the task of making sure the document displays in the toplevel and not the iframe.&lt;br&gt;
&lt;br&gt;
However, this breaks the back button, because &quot;back&quot; goes b ack to where the current page is in the iframe, and it redirects forward again.  This also breaks my nice javascript:history() back button.&lt;br&gt;
&lt;br&gt;
Is there any way with css, javascript, iframe options, etc, to make sure that all links clicked within an iframe open in the parent frame?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.71917</guid>
		<pubDate>Wed, 19 Sep 2007 10:52:11 -0800</pubDate>
		<dc:creator>RustyBrooks</dc:creator>
		
			<category>css</category>
		
			<category>javascript</category>
		
			<category>iframe</category>
		
			<category>links</category>
		
			<category>backbutton</category>
		
	</item> <item>
		<title>By: RustyBrooks</title>
		<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects#1071120</link>	
		<description>(To be clear, I know about putting target=_parent in the links, but I&apos;d *really* rather not parse the text to add this to each link if I don&apos;t have to)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71917-1071120</guid>
		<pubDate>Wed, 19 Sep 2007 10:55:03 -0800</pubDate>
		<dc:creator>RustyBrooks</dc:creator>
	</item><item>
		<title>By: xil</title>
		<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects#1071413</link>	
		<description>I don&apos;t know of any clean way to do that; setting the target on all links (and forms, for that matter) in the document in the iframe is the best way I know of.&lt;br&gt;
&lt;br&gt;
Instead of parsing the inner HTML and messing with it, you could run a script in the outer document which would use the DOM to find links and forms in the inner document, then set their targets as necessary (if not already set).  Of course you&apos;d want to wait until the inner doc is fully loaded, which is tricky itself.&lt;br&gt;
&lt;br&gt;
If there&apos;s a simple and robust solution to this, I&apos;d love to know myself!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71917-1071413</guid>
		<pubDate>Wed, 19 Sep 2007 14:08:59 -0800</pubDate>
		<dc:creator>xil</dc:creator>
	</item><item>
		<title>By: RustyBrooks</title>
		<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects#1071428</link>	
		<description>I made a regular expression, and it works for all my test cases, but I am really hesitant to put it out in the wild.  Ditto for the javascript.  Especially since, to me, this is just a minor annoyance (although it has been put to me to solve it.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71917-1071428</guid>
		<pubDate>Wed, 19 Sep 2007 14:17:43 -0800</pubDate>
		<dc:creator>RustyBrooks</dc:creator>
	</item><item>
		<title>By: joquarky</title>
		<link>http://ask.metafilter.com/71917/Problem-with-iframe-links-and-redirects#1072433</link>	
		<description>&lt;a href=&quot;http://jquery.com/&quot;&gt;JQuery&lt;/a&gt; was made specifically for easily selecting a set of DOM elements and applying changes to them.  &lt;br&gt;
&lt;br&gt;
I&apos;ve not used it extensively, so I couldn&apos;t give you the exact code, but if you look &lt;a href=&quot;http://docs.jquery.com/How_jQuery_Works&quot;&gt;here&lt;/a&gt;, under &quot;Making Something Happen on Click&quot;, it should be fairly easy to modify that to change the target attribute.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71917-1072433</guid>
		<pubDate>Thu, 20 Sep 2007 11:23:46 -0800</pubDate>
		<dc:creator>joquarky</dc:creator>
	</item>
	</channel>
</rss>
