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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:53:48+00:00 2026-06-15T11:53:48+00:00

Hello, I do not know very much about javascript, not much at all to

  • 0

Hello,
I do not know very much about javascript, not much at all to be specific, and i’m french (this means sorry for my english).

since i don’t know a lot about html and everything, i’m just changing the css and html on tumblr existing theme (i know it’s not the very best solution but it’s working for me and i’m improving slowly my knowledge about this world)

so in tumblr you have several pages already created like the one that regroup all your post with the same tag, this page is called http://myblog.tumblr.com/tagged/mytag

Here is my problem : i would like to change the header for each of these pages !

I don’t have access to the php code (wich seemed to be the best solution…)
here is when i have one header :

<body>
  <div id="header">
     <a href="/"><img src="{image:Header}"/></a> 
  </div>
</body>

i have code the css so that my header looks fine to me

to answer my problem, i tried javascript :

<body>
  <div id="header">
    <script>

var image = new Array("{image:Header}", "http://static.tumblr.com/my-other-image.jpg")

if(document.URL.indexOf("/") >= 0) {
    image.src = "{image:Header}"
    }

if(document.URL.indexOf("/tagged/mytag1") >= 0) {
    image.src = "http://static.tumblr.com/my-other-image.jpg"
    }

    </script>            
  </div>
</body>

obviously it didn’t work, and you may be laughing watching what i wrote…
since i only have 3 or 4 pages i’d like to change, i’m ok with the “dirty solution” with too much code, and i just think that i need an “else” for all the other pages !

Thank you for telling me how to make it work and sorry to take some of your time for a simple thing like this wich may not be even possible. and sorry for talking about my life in my terrible english.

Thank you

  • 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-15T11:53:50+00:00Added an answer on June 15, 2026 at 11:53 am

    you must create a image element, then append to the dom:

    <body>
        <div id="header"></div>
        <script>
            var uris = ["{image:Header}", "http://static.tumblr.com/my-other-image.jpg"];
            var image = document.createElement("img");
            if (document.URL.indexOf("/") >= 0) {
                image.src = uris[0]
            }
            if (document.URL.indexOf("/tagged/mytag1") >= 0) {
                image.src = uris[1]
            }
            document.getElementById("header")
                .appendChild(image);
        </script>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone don't know why this code works on windows but not on linux
Hello not sure why Im getting this error. Basically I get it in these
Hello! I'm not even sure if this is possible, but hopefully it is in
Hello I asked this question to superuser but I did not get a good
i do not know wcf but very soon i have to learn it. so
Ok guys I know this question has been asked before but I am very
This is a very basic question. The extent of the answer i know to
This is definitely a very naive question since I am new to node.js. I
I just learned about Servlet in Java but right now, I do not know
At first, this might not seem the proper place to ask this... But since

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.