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

  • SEARCH
  • Home
  • 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 8449801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:48:34+00:00 2026-06-10T10:48:34+00:00

Hi this has doing my head in for an hour or so now, I

  • 0

Hi this has doing my head in for an hour or so now, I want to redirect my mobile traffic but depending on the GEO to different locations, I have got the redirect script working fine using switch, case but when I add it within an if statement if (screen.width <= 699) for mobile devices its not working and I dont know why. this is what i have

 <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
 <script language="JavaScript">
   var country = geoip_country_code();
   if (screen.width <= 699) {   
   switch (country)
   {
   case (country = "ES"):
     window.location = "http://url1.com";
   break;
   case (country = "US"):
     window.location = "http://url1.com";
   break;

   default:
     window.location = "http://url2.com";
   break;
  }
 }

Just having it like this work fine…

 <script language="JavaScript">
var country = geoip_country_code();
switch (country)
{
case (country = "ES"):
  window.location = "http://url1.com";
break;
case (country = "US"):
  window.location = "http://url1.com";
break;

default:
  window.location = "http://url2.com";
break;
}

thanks in advance to anyone who can help me with this I really appreciate it!

  • 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-10T10:48:35+00:00Added an answer on June 10, 2026 at 10:48 am

    Include the following in your html’s header:

    <meta name="viewport" content="width=device-width, user-scalable=no" />
    

    So your mobile devices don’t resize to “desktop” emulation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This thing has been doing my head in for a little while now and
This has probably something to do with my transformations, but right now I can't
this problem has been doing my head in and I hope you can help!
This probably has a simple solution to it but i can't wrap my head
This has been doing my head in. Hope you guys can help. I can't
this has baffled me for a couple of hours now. Why do i get
This has been frustrating me for a while now. I started developing a site
This has defeated me. I want to have a static class variable which is
This has to be a frequent question, but not on SO yet, so it
This has happened before to me, but I can't remember how I fixed it.

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.