Results 1 to 8 of 8

Thread: Page redirect

  1. #1
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Page redirect

    Hello all i am new in this site; i think need help

    as it seen, redirect operations can be made with many ways. but i dont know how I can make redirection using the onload function of the body tag. can you write here for redirection with body onload
    Thanks for your help...

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

    Default

    onload redirections aren't necessary. Use:
    HTML Code:
    <meta http-equiv="refresh" content="5;newpage.htm"/>
    in your <head> to redirect the user to newpage.htm in five seconds.
    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
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This will not work for non javascript enabled browsers:
    HTML Code:
    <body onload="window.location.replace('some.htm')">
    which could be a good thing, depending upon what your objectives are.

    Also, if the page this is on takes a long time to load, it will not go to the new page for awhile. If you want close to instant redirection use:
    Code:
    <script type="text/javascript">
    window.location.replace('some.htm')
    </script>
    in the head, right after the opening <head> tag. Once again, only javascript enabled browsers will 'get it'.
    - John
    ________________________

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

  4. #4
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i cant manage it. these are useless.
    for example=>> if the site which will be redirect is this : http://www.site.com/hacked.asp
    What should i write ?? but for redirection with body onload...
    thanks...

  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

    Twey,

    What do you think, should we tell him? Or, have we said too much already?
    - John
    ________________________

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

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

    Default

    Oh, I think he should be able to figure out the answer from the above posts. If he puts his mind to it.

    "Useless," indeed.
    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!

  7. #7
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ohh..sorry, excuse me..I think there is a missunderstanding here.To tell you the truth, this is a level(page redirect) in a site. in order to pass the level at issue, I have to know redirect codes but i tried the aforementioned codes and much to my regret they werent usefull. It should be the another answer of this question. I have written all of them and i couldnt succeed.
    I need your help guys!!!

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

    Default

    Which browser are you using?
    If it's a modern, up-to-date browser, and you haven't disabled either feature, both the Javascript redirect and the meta-refresh should have worked. Check you have entered them properly, and post a link to the page so we can have a look at it.
    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!

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
  •