Unable to use _parent in target attribute HTML - html

I am trying to use the target attribute with _parent as its value.
Here is the first code
<html>
<head></head>
<frameset rows="30%,70%" >
// About Frame1
<frame src="" name="" />
// about Frame2
<frameset cols="50%,50%">
<frame src="targetattribute_file1.html" name="" />
<frame src="" name="" />
</frameset>
</frameset>
<body>
</body>
</html>
And this is my second file (targetattribute_file1.html )
<html>
<head></head>
<body>
Click here for youtube
</body>
</html>
It opens the file in a full window instead of opening in the parent frame. Wats wrong with code??

Related

Links are not opening properly in the bottom frame

I am working with frames for the first time. Here is
index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<frameset rows="20%,*">
<frame name="top" src="top.html" name="topmenu" />
<frame name="main" src="content.html" name="content" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
top.html
<html>
<head></head>
<body>
<div id="container">
<!-- begin navigation -->
<nav id="navigation">
<ul>
<li>Contact</li>
</ul>
</nav>
<!-- end navigation -->
</div>
</body>
</html>
content.html
<html>
<head></head>
<body>
Some Content
</body>
<html>
contact.html
<html>
<head></head>
<body>
Contact page
</body>
<html>
With this, the output is as under
Now when I click on the Contact link, instead of displaying the content in the content.html, it opens in a new tab as under
What is the mistake I am making. I believe there is some problem from my side in choosing the proper target.
Frames are not supported in HTML5 ^, it is deprecated, and to get it working the <!DOCTYPE> must be set to either HTML Frameset DTD or XHTML Frameset DTD.
If you check the HTML setting in this jsFiddle you'll see that I had set the DOCTYPE to "HTML 4.01 Frameset" in order to make it works, as in this image:
** Also Note that you have used the name attribute twice in each frame tag and there should be only one!
<frame name="top" src="top.html" name="topmenu" />
<frame name="main" src="content.html" name="content" />
^ Sources:
https://developer.mozilla.org/en/docs/Web/HTML/Element/frame
http://www.w3schools.com/tags/tag_frame.asp

frameset not working in IE but works fine Mozilla

Here's the code that works fine in Mozilla but do not works in Internet Explorer. Any idea. Urgency is high.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<FRAMESET rows="15%,81%,4%">
<FRAMESET>
<FRAME src="header.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET cols="40%,60%">
<FRAME name="login_menu_frame" src="login_box.html" frameborder="0" scrolling="no"></FRAME>
<FRAME name="login_body_frame" src="login_page_body.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET>
<FRAME name="login_footer_frame" src="footer.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
</FRAMESET>
</html>
Well, I found the answer. The problem lies in the
IE is only recoznising the first . So, whatever is placed after that is not being loaded in the page.
The solution is to put every other frameset in the first [any other frameset] .
The code that worked is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<FRAMESET rows="15%,81%,4%">
<FRAMESET>
<FRAME src="header.html" frameborder="0" scrolling="no"></FRAME>
<FRAMESET cols="40%,60%">
<FRAME name="login_menu_frame" src="login_box.html" frameborder="0" scrolling="no"></FRAME>
<FRAME name="login_body_frame" src="login_page_body.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET>
<FRAME name="login_footer_frame" src="footer.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
</FRAMESET>
</FRAMESET>
</head>
</html>
What's up with the CAPS, copy-pasted this from actual -96 sources found on a floppy? ;-P
Also, try and apply consistent indentation for the tags. Your main frameset tag is directly followed by another (rouge) frameset tag, which missing closing tag..
Example usage that clearly indicates which elements are contained inside each other for quick mismatch spotting:
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows="10%,80%,10%">
<frame name="top" src="/html/top_frame.htm" />
<frame name="main" src="/html/main_frame.htm" />
<frame name="bottom" src="/html/bottom_frame.htm" />
<noframes>
<body>
<h1>Your browser does not support frames.</h1>
</body>
</noframes>
</frameset>
</html>

Link not working with frame tag in html

I need 3 pages merged in one single page with frame tag so I used a frametag with the src attribute but its not working, is frame tag now obsolete or is it just me?
Here's the code
<html>
<style ="text/css"> </style>
<frameset cols="33.3%,33.3%,33.3%">
<frame src="1.html">
<p>hello</p>
<frame>
<p>productivity</p>
</frame>
<frame>
<p> Entertainment</p>
</frameset>
All the frame pages should follow these mandatory rules:
Page containing <frameset> should not include <html> and/or <body> tags.
The <frame> tags must be close using either <frame></frame> or <frame />.
The <frame> tags must have an 'src' attribute and without src attribute, the space allocated for it will be displayed as a blank page.
For your need the following will be the required answer:
Frame.html
<frameset cols="33.3%,33.3%,33.3%">
<frame src="1.html" />
<frame src="2.html" />
<frame src="3.html" />
</frameset>
1.html
<html>
<body>
<p>Hello</p>
</body>
</html>
2.html
<html>
<body>
<p>Productivity</p>
</body>
</html>
3.html
<html>
<body>
<p>Entertainment</p>
</body>
</html>

How can I use html file into another one

I am creating a web site include navigation bar using only front end code...html ,css and script. but I want to add nav bar in each page by an already created html file.
I am using HTML5 that deprecated frameset tag. So which technique could I use without other backend code to add that html file to another one? Thanks.
<frameset rows="200,*" frameborder="no" border="0" id="container" scrolling="yes">
<frame src="nav.html" name="leftframe" scrolling="no" noresize="noresize" id="nav" />
<frame src="slider.html" name="rightframe" scrolling="no" noresize="noresize" id="slider" />
<frame src="text.html" name="bottomframe" scrolling="no" noresize="noresize" id="text" />
<frame src="copy.html" name="bottomframe" scrolling="no" noresize="noresize" id="text" />
</frameset>
You can switch <frame> for the <iframe> element and get the same results with some CSS.
using jQuery:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function(){
$("#navbar").load("navbar.html");
});
</script>
</head>
<body>
<div id="navbar"></div>
</body>
</html>

Frameset not displaying

I got this exercise I have to make involving framesets. I've created this html:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<frameset rows="50%,50%" cols="50%,50%">
<frame src="../../topleft.html" name="topleft">
<frame src="topright.html" name="topright">
<frame src="botleft.html" name="botleft">
<frameset rows="50%,50%">
<frameset cols="50%,50%">
<frame src="brtl.html" name="brtl">
<frame src="brtr.html" name="brtr">
</frameset>
<frame src="botrbot.html" name="botrbot">
</frameset>
</frameset>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>topleft.html</title>
</head>
<body>
topleft
</body>
</html>
All the other html's are identical to topleft.html and therefor I've not included them. Nothing is showing in my browser. What am I doing wrong?
if you are using frameset there is no use of body, so just remove the <body> and </body>.
if you want the browser to display something when no frames are supported follow this link.
Frameset tag can't use the body, so just remove tag after try comes to output.