Log in

View Full Version : iframe problem



sunny
11-19-2005, 07:30 AM
hi ,just see the code


<html>
<head><title>MUTUAL FUNDS</title>
</head>
<body>
<table><td BGCOLOR=RED>HDFC CAPITAL BUILDER--DIVIDEND</TD></TABLE>
<IFRAME SRC="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=HDFC%20Capital%20Builder%20(D)&ff_desc=HDFC%20Asset%20Management%20Co.%20Ltd.&im_id=MZU018&im_ffid=HD" width="100%" height="50%">
<BR><BR>
<HR>
<table><td BGCOLOR=RED>HDFC CAPITAL BUILDER--GROWTH</TD></TABLE>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=HDFC%20Capital%20Builder%20(G)&ff_desc=HDFC%20Asset%20Management%20Co.%20Ltd.&im_id=MZU016&im_ffid=HD" WIDTH="100%" HEIGHT="50%">
<br><br>

<table><td BGCOLOR=RED>UTI MASTER SHARE--DIVIDEND</TD></TABLE>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=UTI%20Mastershare%20(D)&ff_desc=UTI%20Asset%20Mgmt%20Company%20Pvt.%20Ltd.&im_id=MUT094&im_ffid=UT" WIDTH="100%" HEIGHT="50%">
<BR><BR>

<table><td BGCOLOR=RED>TATA DIVIDEND YEILD FUND--DIVIDEND</TD></TABLE>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=Tata%20Dividend%20Yield%20Fund%20(D)&ff_desc=Tata%20Asset%20Management%20Limited&im_id=MTA130&im_ffid=TA" WIDTH="100%" HEIGHT="50%">
<BR><BR>

<TABLE><TD BGCOLOR=RED>TATA DIVIDEND YEILD FND--GROWTH</TD><TABLE>
<IFRAME SRC="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=Tata%20Dividend%20Yield%20Fund%20(G)&ff_desc=Tata%20Asset%20Management%20Limited&im_id=MTA129&im_ffid=TA" WIDTH="100%" HEIGHT="50%">

</body></html>

my problem is that i want a heading<td> before every iframe .but in my explorer it's showing only the first one.Also do tell me why my <br> tags ignored.I am very new with iframes.thanks.

jscheuer1
11-19-2005, 08:55 AM
The iframe tag needs to be closed. In IE it needs a closing tag:

<iframe attributes here></iframe>

Tables should have rows defined and you were missing a closing tag for the last table. Attributes and tags are better rendered in lower case, attributes should be quoted. Using 50% for each iframe's height makes no sense, 100% for each width is not required unless your screen is less than 1024 pixels wide.

Empty <br>'s often do nothing or little and are not needed in a case like this if styling is used.

The main problem was no closing tags on the iframes. The rest of the changes are mostly just good habits that tend to produce crisp, easy to maintain markup. The tables should really be spans.

This works fairly well here:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>MUTUAL FUNDS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
span {
background-color:red;
color:white;
padding:0 5px;
}
iframe, hr {
display:block;
margin-bottom:30px;
}
iframe {
width:90%;
height:500px;
}
</style>
</head>
<body>
<span>HDFC CAPITAL BUILDER--DIVIDEND</span>
<iframe SRC="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=HDFC%20Capital%20Builder%20(D)&ff_desc=HDFC%20Asset%20Management%20Co.%20Ltd.&im_id=MZU018&im_ffid=HD">
</iframe><hr>

<span>HDFC CAPITAL BUILDER--GROWTH</span>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=HDFC%20Capital%20Builder%20(G)&ff_desc=HDFC%20Asset%20Management%20Co.%20Ltd.&im_id=MZU016&im_ffid=HD">
</iframe><hr>

<span>UTI MASTER SHARE--DIVIDEND</span>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=UTI%20Mastershare%20(D)&ff_desc=UTI%20Asset%20Mgmt%20Company%20Pvt.%20Ltd.&im_id=MUT094&im_ffid=UT">
</iframe><hr>

<span>TATA DIVIDEND YEILD FUND--DIVIDEND</span>
<iframe src="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=Tata%20Dividend%20Yield%20Fund%20(D)&ff_desc=Tata%20Asset%20Management%20Limited&im_id=MTA130&im_ffid=TA">
</iframe><hr>

<span>TATA DIVIDEND YEILD FND--GROWTH</span>
<iframe SRC="http://messageboard.moneycontrol.com/mf/mfinfo/snap.php?im_desc=Tata%20Dividend%20Yield%20Fund%20(G)&ff_desc=Tata%20Asset%20Management%20Limited&im_id=MTA129&im_ffid=TA">
</iframe><hr>

</body></html>

sunny
11-21-2005, 12:00 PM
Your modified page is not working.I wanted the titles in <td> form,look at the page below:
http://www.angelfire.com/empire2/funnyland/mf.html

jscheuer1
11-21-2005, 07:38 PM
Your modified page is not working.I wanted the titles in <td> form,look at the page below:
http://www.angelfire.com/empire2/funnyland/mf.html

My version works here in FF, Opera and IE. I will double check its code, as posted, have a look at your link and get back to you.

jscheuer1
11-21-2005, 08:08 PM
That demo page I posted is a stand-alone html page and tested out here just fine, again (I was just being extra sure). Your online demo is a Frankenpage, with so much code on it, it doesn't know which end is up. Try my code as written. In a text editor, open a blank (new) file and paste my code into it, save it as test.htm, run it locally in your browser.

sunny
11-27-2005, 07:47 AM
A last general Question -Does it make any difference in the output if we have comments(a lot as i had) in the page.Does it changes the interpretation of the browser .And thanks a lot.See You in Javascript Section With the same Code But Different Problem.

jscheuer1
11-27-2005, 08:00 AM
Comments properly inserted into code are ignored by the browser. It can sometimes happen that spacing around comments gets interpreted as additional spaces in the markup though, if you are not careful. Any poorly placed (like in the middle of the attributes section of a tag) or improperly delimited comments, are just asking for trouble.

One place where comments can cause big problems, even when they are properly constructed, is in regards to scripts that rely upon a set document structure for the DOM. Generally that is the fault of the script writer though, allowance should be made for possible comment insertion when 'walking the document tree' as this type of scripting is known. Still there are many scripts out there that do this and do not take it into account.