Targeting Frames in HTML: Code to Open Pages in Each Frame

  • Thread starter kasi9
  • Start date
  • Tags
    Frames
In summary: I'll say this again that it is really difficult to help you find the problem when none of us knows exactly what you are doing, if you would post some of the code you are working on it is more likely that someone would be able to spot the problem.
  • #1
kasi9
4
0
in html, i have coded a site with 8 frames i'd say approx, i have a menu with links, when i click on the link i want a page to open in a particular frame, so how do i target it, please give me code, ty

btw _self, _blank etc don't work, i think i need to some how name the frames, to open up pages in each of them
 
Technology news on Phys.org
  • #2
Try
Code:
<frame name="contentFrame">
where you define your frames, then
Code:
<a href="..." target="contentFrame" ...>
 
  • #3
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?
 
  • #4
kasi9 said:
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?

CompuChip's suggestion is the way to do this, but there could be other problems depending on how you are linking to the other page which is really hard to determine without looking at your code.
 
  • #5
kasi9 said:
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?

If you're using frames, then you have a main html page - the frameset page - which contains all the other frames, plus some content pages which have the content for each frame.

Go into the frameset page and name the frames. Adding <frame name=> into a content page will not do it - it may be obvious but from what you said it sounds like that's what you did.
 
  • #6
well guys I'm trying, i renamed some of the frames, and whe i click the link it opens the page in the link page :(

i appreciate ur help so far, but this seems impossible
 
  • #7
kasi9 said:
well guys I'm trying, i renamed some of the frames, and whe i click the link it opens the page in the link page :(

i appreciate ur help so far, but this seems impossible

I'll say this again that it is really difficult to help you find the problem when none of us knows exactly what you are doing, if you would post some of the code you are working on it is more likely that someone would be able to spot the problem.
 

Related to Targeting Frames in HTML: Code to Open Pages in Each Frame

1. What are targeting frames in HTML?

Targeting frames in HTML refers to the use of code to open different web pages within different frames on a single web page. This allows for multiple web pages to be displayed simultaneously on one page, making it easier for users to navigate through different content.

2. How do I create targeting frames in HTML?

To create targeting frames in HTML, you can use the <frameset> and <frame> tags. The <frameset> tag defines the layout of the frames on the page, while the <frame> tag specifies the source of the page to be displayed in each frame.

3. Can I target a specific frame using HTML?

Yes, you can target a specific frame using the target attribute in the <a> tag. By setting the target attribute to the name of the frame, you can open a link in that specific frame instead of the entire page.

4. Are targeting frames still commonly used in web development?

Targeting frames in HTML is not as commonly used as it once was, as newer technologies such as CSS and JavaScript offer more versatile options for creating dynamic and interactive layouts. However, frames can still be useful in certain situations, such as displaying ads or third-party content on a website.

5. Are there any drawbacks to using targeting frames in HTML?

One drawback of using targeting frames in HTML is that it can negatively affect the usability and accessibility of the website. Some users may have difficulty navigating through framed pages, and it may also cause issues with bookmarking and search engine optimization. Additionally, frames may not be supported by all browsers and devices.

Similar threads

  • Programming and Computer Science
Replies
14
Views
830
  • Programming and Computer Science
Replies
2
Views
156
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
893
  • Programming and Computer Science
Replies
23
Views
1K
  • Programming and Computer Science
Replies
24
Views
1K
  • Programming and Computer Science
Replies
4
Views
780
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
0
Views
642
  • Programming and Computer Science
Replies
14
Views
1K
Back
Top