/    Sign up×
Community /Pin to ProfileBookmark

Hi everyone!

I have a small problem.

My problem is as follows:

  • 1.

    On a website, when a individual wants to change language onclick should fire up the following events

  • 2.

    Get the current URL for example [url]www.microsoft.com/us/us/product[/url] change this to, if france is chosen, [url]www.microsoft.com/us/fr/product[/url]. And before changing it, it should make a request to the server to verify that it doesn’t get a 404 response back.

  • 3.

    if it doesn’t get a 404 it should redirect, if it does then it should redirect to the startpage for the selected country.

  • I really hope you get what I want to accomplish. I’m a total newbie at JavaScript so I have no idea where to start.

    Thanks a lot for your answers!

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @FangSep 10.2010 — Ajax, check the return value of [I]xmlhttp.status[/I].
    Copy linkTweet thisAlerts:
    @apefuzzauthorSep 10.2010 — Ajax, check the return value of [I]xmlhttp.status[/I].[/QUOTE]

    That just answers an extremely small portion of my question in general. But thanks.
    ×

    Success!

    Help @apefuzz spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...