Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Javascript styling for a specific url

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #38817

    Here is my site: http://dkurf.esxsb.servertrust.com/
    I need to create specific styling for this page: http://dkurf.esxsb.servertrust.com/ProductDetails.asp?ProductCode=dfhs

    I don’t have access to the html for that page so i need to override the styles that are throughout the site only for that page.

    This is the bit of javascript the company that hosts my ecommerce store provided (Volusion, p.s. don’t ever use them they are a css nightmare!)


    So i went ahead and just put in the background color as a test, but I can’t for the life of me get it to work. I don’t know much javascript so that is probably why. I contacted Volusion and told them about my problem, but they said they don’t provided custom coding. Which doesnt make any sense since they posted this right on their support page yet won’t follow through.
    But if any one has any suggestions, it would be super helpful!

    Thanks!

    EDIT: Fixed it with this script:


    #105637
    Meta_Ing
    Participant

    Each new line within the document.writeln would need to be escaped with a (back slash). For example:

    However, rather than creating an extra style element, you can use javascript to change css directly via the style object. In your case, you would probably want something like the following:

    #105649

    Alright i used your second suggestion, but i still can’t seem to make it work. I put the script in the template_220.html file, if you want to take a look. Thanks!

    #105662
    Meta_Ing
    Participant

    Could you provide a link? I’m not quite sure what the template_220 file is.

    Also, just be aware that the script (if unaltered) will only work if either /ProductDetails.asp, -p, or _p are in the URL’s path name.

    #105676

    It will be in the source of this page: http://dkurf.esxsb.servertrust.com/ProductDetails.asp?ProductCode=dfhs

    I put the script in right after the body tag, But i’m having the worst time getting it to work.

    #105925
    Meta_Ing
    Participant

    Sorry to respond to this so late, but I would just like to suggest that scripts within the body should always be placed after any elements being affected by them. This should allow the element(s) to load first and ensure that the script won’t attempt to operate on something that doesn’t yet exist. (Most likely this was the problem you had with my script.)

    Right before the body closing tag, </body>, (if possible) is the safest place.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.