0

An href's target attribute can be set to display on a separate page by assigning "_blank" to it; e.g., in my site www.DuckbilledPlatypiRUs.org, I could link to another site this way:

<a href="http://www.BigSurGarrapata.com" target="_blank">Garrapata</a>

If I leave the target attribution out, the href'd site replaces the existing site on the browser's current page.

But I want to have the page/site display, not in the user's browser per se, but embedded within my site, in one of its tags; in my case, inside the Contents of an accordion "fold." I tried to get that to work this way:

<div id="accordion">
    <h3>Garrapata</h3>
    <div id="garrapataFold"><a href="http://www.BigSurGarrapata.com" target="#garrapataFold">Big Sur Garrapata site</a></div>

IOW, it's targeting itself; but that doesn't work; it acts as if I had assigned "_blank" to href's target attribute.

So am I going about this completely wrong, or am I close but don't know which value to assign to the target attribute?

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    Typically when I want to embed a page from another site within my own project I've used an iframe tag - there is also probably an ajax option but I'm not not savvy enough with ajax to explain how – fnostro May 13 '13 at 00:43
  • I thought iFrame was deprecated...? – B. Clay Shannon-B. Crow Raven May 13 '13 at 00:52
  • nope - still part of the html5 spec, but the ajax option is probably better, but more complicated. in any case it's a quick way to see if the embedded page will work in the accordion – fnostro May 13 '13 at 00:56
  • Adding the following just plops an empty rectangle into the content area:
    – B. Clay Shannon-B. Crow Raven May 13 '13 at 01:36
  • It's difficult, although not impossible, to get content from other domains to appear in an iFrame. I believe the same is also true of loading content using Ajax, due to the Same Origin Policy: http://stackoverflow.com/questions/6474484/get-cross-domain-iframe-content – Simon Adcock May 13 '13 at 08:14
  • @Clay - - book mark this link http://www.w3schools.com/ – fnostro May 13 '13 at 14:59
  • @fnostro: Isn't that the site Paul Irish has declared war on? – B. Clay Shannon-B. Crow Raven May 13 '13 at 15:02
  • @Clay - kinda missing the point there buddy :) W3Schools is a HUGE compendium of basic knowledge, but it's not the only one I use, point is you should have a whole arsenal of bookmarks of your favorite reference materials. – fnostro May 13 '13 at 15:13

1 Answers1

0

This works well:

<div><iframe src="http://www.bigsurgarrapata.com" width="100%" height="100%"></iframe></div>

...for the most part; not everybody allows themselves to be "confined" this way; flicker shows an errror message, that they don't allow such, and netflix just takes over the browsing session.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862