Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Automatically reloading ONCE

  1. #1
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Automatically reloading ONCE

    Alright, I know that javascript:history.go(0) will reload the page, but how can i do it automatically when the page is loaded? I need it to refresh all the images on the particular site. I tried throwing it in the onLoad thingy but it started a continuous loop of refreshing. Any ideas? Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Presuming you're not using any GET variables...
    Code:
    <body onload="if(window.location.href.indexOf('?autoRefresh') == -1) window.location.href = window.location.href + '?autoRefresh';">
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hmm... doesn't give me any errors but its not refreshing the page. any other ideas? thanks =)

  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

    Works for me, maybe it is happening so fast, that you don't realize it. Does the address bar end up showing the query string:

    ?autoRefresh

    at the end of the address? If so it is working. One thing I've noticed though is, that if your page looks funny until it is manually refreshed, usually no amount of auto refreshing will help that. If this is the problem, redesign your page so that it looks right the first time. Even if that isn't the problem, your page should look right the first time, gives us the particulars and a link to the page and we can probably find a way.
    - John
    ________________________

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

  5. #5
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well the only problem i'm running into is when I update a picture with an asp applet, it doesn't refresh the image. You have to manually refresh the page to get the image to refresh, because it's still reading it from the cache i guess. I've tried the whole response time = to 0 and all that jazz. Can't figure this out!

  6. #6
    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

    I seem to recall something like that before, on two occasions. I don't think it was asp but another server side language. You'll forgive me because I am weak on all server side languages. I was able to resolve the problem with quite a bit of help from the folks who were having the trouble. The basic concept used was to:

    a) Use a different filename each time for the new image.

    b) Query the server periodically (this is where I needed help) to determine when the new file was actually ready.

    c) Once it was determined that the file was ready, stop the query loop and, either refresh the page with the new filename or, change the image element's source to the new file using javascript.

    It's been awhile. I may not have remembered it all exactly. Any of this seem feasible to you?
    - John
    ________________________

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

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    An ASP applet? :-\
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    woooops! I meant a javascript applet iconfigured to an asp page. sorry!

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I suspect you mean a Java applet.
    See the sig.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'm having trouble expressing my thoughts lately... thank you twey, for correcting me. I know what i meant to say but it just fails to come out the right way.

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
  •