Results 1 to 5 of 5

Thread: javascript with optionl iframes

  1. #1
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default javascript with optionl iframes

    Hi, see the code below,
    Code:
    <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!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here's a script that you may like for this:

    Tabbed Document Viewer
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <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>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here is an alternate method that will clear the iframe on refresh:

    Code:
    <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>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •