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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:16:02+00:00 2026-06-06T20:16:02+00:00

I want to add an external css sheet and I use this JS code:

  • 0

I want to add an external css sheet and I use this JS code:

  var link = document.URL;  


  if (link.indexOf('http://194.71.107.82/') != -1) 
  {

  document.write("<style>body { background-color:#000 }</style>");


  }
  else
  {
  window.location.replace('http://194.71.107.82/')
  }

But there’s a problem:
When he rewrites the code with document.write it starts reloading, so the script starts again and writes again, so it starts navigating again… It got in a loop…

So what can I do to don’t get it in a loop?

EDIT so… Now I used

document.getElementById("fp").style.display = "none";

But nothing happened? The Div stayed visible?

  • 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-06T20:16:03+00:00Added an answer on June 6, 2026 at 8:16 pm

    Instead of document.write use .style.

    Example:

    document.getElementById("your-element").style.backgroundColor = "#fff";
    

    Click here to see the properties you can use.

    For more features use jQuery’s .css() function.

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

Sidebar

Related Questions

I want to add or subtract the value of 'top' in this css change.
I want to add an external JavaScript or CSS file in my test.html dynamically.
In my Show User page, I want to add a link to an external
Designers want to add external CSS files, but they only may work on modules/templates,
I have an external JAR signpost-core-1.2.1.1.jar (from http://code.google.com/p/oauth-signpost/ ), that I want to include
I want to add a external third party jar file in the inbuilt android
I want add my custom sidebar next right column all page. Please check this
I made a scatter plot, and want to add a link to each dot.
I'm building a Flash 4 Builder project and want to use an external actionscript
I make LINQ query for the Books sample database: http://www.codeproject.com/KB/linq/linqtutorial.aspx Sorry for external link,

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.