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 6529059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:35:37+00:00 2026-05-25T09:35:37+00:00

I have a website with some content. Based on the users screen resolution i

  • 0

I have a website with some content. Based on the users screen resolution i want to show different content so that mobile devices will have some other content, but the rest of the site will be the same. I did some research, and it seems like the only possible way is with javascript. I code PHP most of the time, so i really suck at javascript, so it would be nice if someone could provide me with a simple script.

What i need is a javascript function like this:

if (screen resolution < X x X) {
show some content...
} else {
show some other content ...
}

If javascript is off, it should just show some other content.. 🙂 I can install jquery if it helps. Thanks

It would be nice with examples for the html code too.

  • 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-05-25T09:35:38+00:00Added an answer on May 25, 2026 at 9:35 am

    you should NOT detect if the user is on a mobile device with javascript. i recommend you this in PHP. you can use [$_SERVER‘HTTP_USER_AGENT’] and then simply parse out the string to see what kind of user agent it is. I am actually implementing this same concept right now.

    you can also use this class Mobile Detect

    include("Mobile_Detect.php");
    $detect = new Mobile_Detect();
    
    if ($detect->isMobile()) {
         // any mobile platform
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an open source'd website. Some content is private such as connection parameters,
Let say that I have a website with some information that could be access
I have a website that i did some time ago now they request some
We have a website that uses #include file command to roll info into some
I have a website built with ASP.NET (3.5) and want add some level of
I have a website where an ajax call will get some Json data from
I have a website that would ideally be accessed by users who have downloaded
I have drupal based website (Drupal version is 6.19), it is very heavy content
I have some website which requires a logon and shows sensitive information. The person
I have a website (ASP.NET) and some winforms(.Net 2.0) for a project (written in

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.