Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question iFrame refresh problem

    hints have been given -- but with no results sofar.
    problem : only iFrame not complete window refresh

    below the code for the 2 files. Another thing is that the var id_iframe is not defined in src_iframe.htm (NS console reporting).
    When you shrink your IE browser so that scrollbars appear - clicking the button will refresh the whole window + scroll action. How to avoid this ??? NS is not scrolling but didn't recognize the id_iframe var.

    Tx -- happy year ending to all




    iFrame.htm

    <html>
    <head></head>
    <body background="bg.jpg">
    <p>Problem iFrame refresh</p>
    <div align="center">
    <IFRAME name="name_iframe" id="id_iframe" src="src_iframe.htm" scrolling="no" width="550" height="410" frameborder="0">
    </IFRAME>
    </div>
    </body>
    </html>

    src_iframe.htm

    <html>
    <head>
    </head>
    <body background="bg.jpg">
    <p>src_iframe.htm</p>
    <a href="#"><IMG name=image border=0 src = "button.gif" onclick=" document.frames[id_iframe].location.reload();" ></a>
    </body>
    </html>

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    why not just:

    onclick="location.reload();"

    since you are already inside the iframe and want to reload itself.

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tx ,

    but it didn't solve the scrolling issue

    make your IE window so that scrollbars appear on the right side and you will see.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    try:

    onclick="location.replace(location.href);"

    that's another trick to reload the page

  • #5
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i tried your last trick but i'm still scrolling in IE
    another thing that I discovered

    the parent page is refreshing but not reloading. I placed an animated gif on the main page and when i click on the reloadbutton in the iFrame the iFrame is reloaded and the parent page is refreshed - the animated continued its loop and didn't start from scratch.

    its boogoy - Tx

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    what do you exactly mean by scrolling? Do you mean when you click the reload button in the iframe, the page is refreshed then it will scroll down to its previous position before resfreshing?

    and what do you mean by this, "the parent page is refreshing but not reloading"?

  • #7
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    example : animated gif - pictures counting from 1 to 10 -- cfr intro from old movies

    place this gif in the iFrame (src_iframe.htm) and on the parent page (iFrame.htm).

    when the animated gif reaches the 5 click reload button in iFrame (use location.reload().)

    The animated gif on the parent page continues its loop: displays 6 en further; the animated gif in the iFrame page starts from 1 again.

    the problem of the scrolling is that it will scroll up and not too the previous position before resfreshing -- actually i dont want it to scroll at all.

    watch out location.replace(location.href) is a refresh function and not a reload function


    Tx 100times
    i send a postcard for the solution

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    i thought you want to scroll to the top

    ok, try:

    <a href="#" onclick="location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>

    if that doesn't work, then try this:

    <a name="reload"></a>
    <a href="#" onclick="location.replace(location.href+'#reload');return false;" ><IMG name=image border="0" src="button.gif" /></a>

    Can you differentiate refresh and reload because they are the same.

  • #9
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry it didn't work
    all files attached of my iFrame refresh problem project
    Tx --
    Attached Files Attached Files

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    this works for me:

    <a href="#" onclick="location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>

    it reloads the iframe and not the main page. is this what you want? Im confused on what you need

    if you want the main page to refresh, then try:

    <a href="#" onclick="top.location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>


  •  

    Posting Permissions

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