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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:08:00+00:00 2026-05-20T11:08:00+00:00

i have been tasked with changing a bit of css for a site that

  • 0

i have been tasked with changing a bit of css for a site that i did not build and is quite old. Long story short – building the site from scratch is not an option. There are two CSS stylesheets associated with the site. I have tried combining them with no luck. The first stylesheet is declared in the head section of the document as normal. The second seems to be pulled from the following code:

<script type="text/javascript">
<!--
function P7_StyleLoader(tS) { //v1.3 by PVII
var tH = '',
    tDoc = '',
    tA = '<LIN' + 'K REL="stylesheet" HREF=',
    tB = ' TYPE="text/css">';
if (document.getElementsByTagName) {
    var bb = document.getElementsByTagName("LINK");
    if (bb) {
        for (var k = 0; k < bb.length; k++) {
            if (bb[k].rel.toLowerCase() == "stylesheet") {
                var h = bb[k].href,
                    x = h.lastIndexOf("/");
                if (x > 0) {
                    tH = h.substring(0, x + 1);
                }
                bb[k].disabled = true;
                tDoc = tA + '"' + tH + tS + '"' + tB;
                document.write(tDoc);
                break;
            }
        }
    }
}
}
P7_StyleLoader('STYLE-SHEET-2.css');
//-->
</script>

if i merge them and drop one of these stylesheets from the html, the site pretty much breaks in terms of layout. Could someone tell me if the above code is doing anything else besides just pulling “STYLE-SHEET-2.css”? My thinking is that i’d like to use either the above code and put the other styles into it or vice-versa? Am i missing something here?

thanks!

  • 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-20T11:08:01+00:00Added an answer on May 20, 2026 at 11:08 am

    Yeuk. That is some nasty javascript.

    What it’s doing is roughly this: It scans through any <link> elements in the document already and disables them. It loads the stylesheet specified in the function call instead.

    In addition, it works out what the directory path was in the original CSS include, and appends that to the front of the stylesheet it’s loading, so that it is loaded from the same path as the original would have been.

    The code is (slightly) obfuscated as well, presumably to prevent automated scripts from detecting what they’re doing.

    The question is why would anyone actually go to all that trouble?

    I can’t think of too many reasons why they may have done this. The only thing that makes sense would be to fool spam bots into loading the wrong styles or something similar to that. Make the page look different to a bot to how a human would see it. Possibly trying to fool search engine bots too, but that would be considered a very bad move – if Google catches on to that you’d get black-listed.

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

Sidebar

Related Questions

I have been tasked with going through a number of ColdFusion sites that have
I have been tasked with developing a solution that tracks changes to a database.
I have been tasked with creating a program that will generate an amortization schedule.
I have been trying this for so long, but was not able to implement
I have been tasked with implementing a PKI library in C# for a company
I have been tasked with coming up with a compatibility guide for SharePoint 2007
I have been tasked to optimize some sql queries at work. Everything I have
I have been tasked with finding an open source DOM XML parser. The parser
I have been tasked with creating a program what will create take files in
I have been tasked with converting several php classes into java classes, which is

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.