#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0

    How to make an external redirect page that redirect from browsersurl


    I have some url in page going ti external.html

    external.html?link=page_to_redirect

    How can I get the url from the browsers url line??

    How can I redirect to a external page using javascript, all external links will go to the external.html and should be redirected from there to the right page.



    Regards
    Brian Olsen
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,158
    Rep Power
    184
    Make a function and in that function; create a variable, that gets the window.location/document.location and split() the query string. Then place that variable in window.replace() and add a onload event handler to trigger this function.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0

    No knowledge about javascript


    Can you help little more I have no knowlege about javascript at all
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,158
    Rep Power
    184
    If you will do an online search for these terms:

    • window.location/document.location
    • split()
    • window.replace()


    then... you will see how to do this. If you make an effort to write some code; that is applicable to the above terms, I then will make an effort to get you headed in the right direction, but I will not write the code for you and... even, if I did; that will not help you. Because the objective of this forum, is... for "you" to learn how to use JavaScript.

IMN logo majestic logo threadwatch logo seochat tools logo