PDA

View Full Version : javascript with optionl iframes



sunny
11-27-2005, 08:06 AM
Hi, see the code below,


<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>

IS IT POSSIBLE TO make these iframes open at different time intervals whith setTimeout.If yes,How?Alternatively is it possible to Make a drop Down window with an empty iframe below it.And the drop down menu having all the URL options in it.And when one Url is selected it Should open in the iframe below it.Trying to be a bit Complex with iframe!

jscheuer1
11-27-2005, 10:06 AM
Here's a script that you may like for this:

Tabbed Document Viewer (http://www.dynamicdrive.com/dynamicindex3/tabdocviewer.htm)

sunny
11-28-2005, 11:03 AM
That's somthing which i knew. But, what i wanted to know was whether it is possible to open different iframes with the help of SetTimeout(at different intervals).Just give 1 example of function if it is possible.

jscheuer1
11-28-2005, 05:34 PM
Well, in most browsers, refreshing the page will only reload whatever is currently in an iframe. But, on a first time page load, this works:


<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="blank.htm">
</iframe><hr>
<script type="text/javascript">
setTimeout("frames[0].location.replace('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')", 14000)
</script>
</body></html>

jscheuer1
11-28-2005, 05:47 PM
Here is an alternate method that will clear the iframe on refresh:


<script type="text/javascript">
if(!window.opera)
frames[0].location.replace('blank.htm')
setTimeout("frames[0].location.replace('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')", 14000)
</script>