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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:56:11+00:00 2026-05-20T01:56:11+00:00

HELP! lol i cant figure it out!! aaarrrghhhh heres what i got HTML: <html

  • 0

HELP! lol i cant figure it out!! aaarrrghhhh

heres what i got

HTML:

<html xmlns="http://www.w3.org/1999/xhtml" class="bg1">

Jquery:

$(document).ready(function(){
  var identifier = window.location.pathname;
  switch(identifier)
        {
            case: 'where-to-buy-our-goods.php';
            $('html').removeClass('bg1').addClass('bg2');
            break;
            case: 'about.php';
            $('html').removeClass('bg1').addClass('bg3');
            break;
            case: 'press.php';
            $('html').removeClass('bg1').addClass('bg4');
            break;
            case: 'contact.php';
            $('html').removeClass('bg1').addClass('bg5');
            break;
        }

});

also i think this might have something to do with it…

my site is in a folder on the root as a tester…

so the url is http://www.URL.com/Folder/about.php for exapmle… idk if this changes what the window.location.pathname should look like…

please help

  • 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-20T01:56:11+00:00Added an answer on May 20, 2026 at 1:56 am

    In order to decide off the path of the url bar:

    $(document).ready(function(){
      var identifier = window.location.pathname;
      switch(identifier)
            {
                case: 'index.php';
                //edit proper tag's css
                $('body').css('background','img.jpg');
                break;
                case: 'about.php';
                //edit proper tag's css
                $('body').css('background','img2.jpg');
                break;
            }
    
    });
    

    Substitute body for the proper tag.

    Perhaps though, there are better alternatives to this… couldn’t you have different body classes to change the background image depending on what page you are on?

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

Sidebar

Related Questions

I'm trying to figure ruby out a bit more..... If I have an object
ok.. I know I can find help here :) I am barely out of
i have to make a java program (an artichoke cipher) well... please help lol
Help! I have an Axis web service that is being consumed by a C#
Help me ..my page index is not working in visual studio. my page load
Help! I am using jQuery to make an AJAX call to fill in a
Help! I have a PHP (PHP 5.2.5) script on HOST1 trying to connect to
help me to manage IIS (what i am trying to do is create virtual
Help I am busy making changes to a type library in a Datasnap project.
HELP! I just setup a virtual host for two sites that have a lot

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.