Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:01:38+00:00 2026-06-09T11:01:38+00:00

I have a simple .htm web page kept in different folders for handling different

  • 0

I have a simple .htm web page kept in different folders for handling different languages.

default.htm inside en folder (en\default.htm and de\default.htm and so on)

I need to redirect to a specific web page based on the URL parameter i.e. if the user had

specified http://localhost/website/default.htm?lang=de, i need to redirect him to the

de\default.htm file. i.e. a german web page.

had it been the ASPX pages i would have done away with the job easily with ResourceManager

and an appropriate .resx file using the Request.QueryString option provided by .NET

BCL. However since i’m using plain HTML page i do not have an expertise to write a client

side script like javascript to query for the URL parameters and redirect the user to the

required page.

Question :

Can anyone guide me how do i achieve the same using any form of client scripting to

achieve the redirection ?? And where do i invoke the script function ?

i.e query the parameter for each post event.??

Thanks a ton

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:01:39+00:00Added an answer on June 9, 2026 at 11:01 am

    You can use javascript to get a list of params pretty easily with the following line.

    var paramArray = window.location.search.substring(1).split("&")

    This will build an array of the parameters of the query string. From there you just need to add logic to find the param you specified in your question and take the appropriate redirect using

    window.location.href = 'some URL'; //causes the browser to refresh with the new URL

    Example:

    function getQueryStringArray(){
        var assoc=[]; 
        var items = window.location.search.substring(1).split('&'); 
        for(var j = 0; j < items.length; j++) { 
           var a = items[j].split('='); assoc[a[0]] = a[1]; 
        }
        return assoc;
    }
    
    //point at which you want to determine redirection
    var qs = getQueryStringArray();
    var url = '';
    if (qs.lang !== 'undefined' && qs.lang) {
       switch (qs.lang) {
          case 'en':
             url = 'blah';
             break;
          case 'de': 
             url = 'meh';
             break;
       }
       window.location.href = url; //reroute
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple CSS problem In this site http://web.cinaird.se/pdf/test.htm (<--removed) I have a
I have hundreds of .doc files with text that I need put on web
I have very simple NetBean Project. It include this controlller line, @RequestMapping(value = /MyDoc.htm,
I have created simple Java Dynamic Web project in Eclipse. I host my project
I have a simple WCF web service I tried to connect with jquery and
I have a simple redirect which I just can't get to work and I
I have a application that I deployed to web server. Users go to publish.htm
I have a simple question (but I'm not a programmer...) On http://www.strahlen.org/index.htm I manually
I have two pages - a simple HTML code example page from a jQuery
I have a simple jQuery click and scrollTO anchor script. I have another page,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.