/    Sign up×
Community /Pin to ProfileBookmark

Iframes and links

I’ve been trying to figure this out, but I’m coming up with nothing.

I want to link to a page that has an iframe (Our Animals) on it, and when it loads, I want another specific page (Raven the Wolf) to be inside the iframe. Right now, if I link to Our Animals, the default page (Introduction to Our Animals) will load. What can I type into a link to make Our Animals load with Raven the Wolf inside the iframe?

*Did that explanation make sense? I was hoping naming the pages would help. If it didn’t, just tell me and I’ll come up with another way to explain it.

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerMar 04.2007 — Not quite, could you point us to a page and then clarify a little more?
Copy linkTweet thisAlerts:
@AthenaJellicleauthorMar 04.2007 — Okay, I'll try better.

http://www.wildspiritwolfsanctuary.org/meet_our_animals.htm

This is the "Our Animals" page. The lighter colored box is the iframe which will load "Our Animal Introduction" page by default. If you click on the links to the left of the iframe, you can scroll through the different animals at our sanctuary. If you click on a thumbnail, it will bring you to the animal's page.

There will be times when I reference an animal's name (like Raven the wolf) on a seperate page on the website. If you click the animal's name (which would be a link), I would like for Raven's page to appear in the iframe on the "Our Animals" page. This way, people would not have to go through the hassel of finding Raven's thumbnail and then clicking on it to get his page.


Did that make sense? If you have any more confusion, please tell me, and I'll try again.
Copy linkTweet thisAlerts:
@ray326Mar 04.2007 — I see you're on an ASP.NET server. Instead of an iframe you could make that a div and build the page using an ASP server side include to get the content for that div. Alternatively you could leave the iframe and set its src dynamically using an ASP variable or expression.
Copy linkTweet thisAlerts:
@ryanbutlerMar 04.2007 — If I understand you correctly, it's simply a matter of linking to the name of the iframe, therefore, the name of the iframe in this case is:

[CODE]<iframe src = "animals/animals_intro.htm" [B]name = "animals"[/B] frameborder = yes height = 100% width = 100%>[/CODE]

Animals, so when you link Raven to load into the intro page, do this:

[CODE]<a href="ravenspage.html" [B]target="animals"[/B]>Raven</a>[/CODE]

Where target tells the link to open Raven The Wolf into the intro page.
Copy linkTweet thisAlerts:
@AthenaJellicleauthorMar 04.2007 — Unfortunately, I tried that.

[code=html]<a href = "animals/wolves/Raven/raven.htm" target = "animals">Raven</a>[/code]

Instead of doing what I want, Raven's page just pops up into a new window, like if I used a "_blank".

That's why I am so lost. But I would appreciate any more help you could give me.
Copy linkTweet thisAlerts:
@ray326Mar 05.2007 — You can't do it with straight HTML. Hence my suggestion to use the ASP that you have available on your server. Make your "our animals" page an ASP page and have it interpret a query string naming the featured animal, e.g. Raven. Then a Raven link would look something like.

<a href="/meet_our_animals.asp?animal=Raven">Raven</a>
Copy linkTweet thisAlerts:
@ryanbutlerMar 05.2007 — I must be misunderstanding, b/c I don't see why you need a server-side solution. Have you tried replacing target animals with _self?
Copy linkTweet thisAlerts:
@AthenaJellicleauthorMar 05.2007 — To RyanButler: I just tried replacing "animals" with "_self", but Raven's page will just load, not the Our Animals or the iframe.

To Ray326: Unfortunately, I have never worked with ASP, so I don't know exactly what you're talking about. But it sounds like I might have to look it up.
Copy linkTweet thisAlerts:
@ray326Mar 05.2007 — I must be misunderstanding, b/c I don't see why you need a server-side solution.[/QUOTE]Because the references are on a different page. The page with the iframe has to load AND the iframe has to have the proper src. It could probably be done with Javascript but it's best done by creating the page dynamically in the first place. Target will only work if the link is on the parent of the iframe.
×

Success!

Help @AthenaJellicle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...