• Resolved tomhanna

    (@tomhanna)


    I have a Javascript that is messing up a theme, causing 50 some validation errors and making the posts column slide down the page in Internet Explorer. I tried the external javascript thing and I must not be doing it right because I can’t get it to run at all that way.

    I’m using the 4-column Identification Bands theme. This is the site:
    https://election2008.tom-hanna.org

    I put the Javascript in this file:
    https://election2008.tom-hanna.org/setcountdown.js

    In addition to the stuff inside the scripts tag, the script uses this code:
    <ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight}; bgColor=&{countdownbgcolor}; visibility=hide><layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}; left=0 top=0></layer></ilayer>

    which I have tried including in the external Javascript file and also tried just adding it to the template file. I read Lorelle’s excellent post on the subject of external javascripts at her blog and several other resources and either I’m not doing it right or there’s something interfering. Is there any other solution?

    I’ve tried putting this in every template file except the footer and I still get the issue, even if I put it after the post content. It won’t do much for me in the footer.

    Nothing urgent here, but any help would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are including external js, remove all the stuff at the top such as comments and what the file is. Your should have as the first line:

    function setcountdown(theyear,themonth,theday){

    Nothing above that. See what that does ?

    I can’t see how you are including. I do it this way:
    <script type="text/javascript" src="https://www.tamba2.org.uk/T2/files/ntitles.js"></script>

    Thread Starter tomhanna

    (@tomhanna)

    Thanks. That got the Javascript working without validation errors, but the Internet Explorer problem with the post content sliding down the page is still happening.

    I’m enclosing the script in it’s own <div> and this is all I put in the stylesheet for it:

    .countdown {
    text-align: left;
    font-size: 40%;
    }

    I’m digging through all the posts for similar issues looking for anything relevant.

    Thread Starter tomhanna

    (@tomhanna)

    Sorry to bump, but I set the content width to auto and that fixed it in Internet Explorer, but now the content appears at the bottom of the page in Firefox.

    Thread Starter tomhanna

    (@tomhanna)

    Problem solved! I found this page on “Hack-free CSS for IE”

    https://virtuelvis.com/archives/2004/02/css-ie-only

    Thanks for the help with the javascript, podz.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Javascript messing up theme’ is closed to new replies.