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

Home Forums JavaScript Embedded Javascript Form From External Site, Cannot Override The CSS

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #155538
    Tom Houy

    I have a form from an external vendor that I am embedding into a web page via javascript. I would like to override the CSS being pulled in along with it since it is interfering with my existing CSS. I’ve tried saving the external CSS files in the paths below, modifying them, then updating the paths in the code to point to the modified CSS files hosted on my own server. However for some reason, it appears to be loading the CSS from the vendor’s site anyhow.

    Any ideas why this might not be working? Is it possible for me to force the javascript code below to use my own CSS files somehow? The site isn’t live yet, so I’ve X’ed out the vendors domain for now. Below is an example of how the form is embedded.

    <meta charset="utf-8" /> 
    <script type="text/javascript" src=""></script> 
    <script type="text/javascript" src=""></script> 
    <script type="text/javascript" src=""></script> 
    <script type="text/javascript"> 
    var mx_var = 
    server: "", 
    target: "#my-form", application_root: 
    "/MXForms/", source_id: "CD1", lead_source: 
    rates_styles: ["", 
    <script src="" type="text/javascript"></script> </head> 
    <div class="header"> 
    <div id="my-form"> 
    <img src="" alt="Loading Form" /> 
    <div class="footer">Footer</div> 
    Tom Houy

    One additional thing, if I load the form into a static page, then embed that page into my site via an iframe, that solves the CSS conflicts. In addition, I can “trump” the CSS being loaded from the vendor with my own CSS specific to that page using “!important”, however I would rather not have to rely on an iframe, and I would prefer to not use their CSS at all.


    server: ""

    I assume you’re trying to obfuscate the actual domain name. It is better to use “” (which was specifically reserved for the purpose of example URLs), rather than “” (which is a for-sale domain that contains links to p0rn sites).

    rates_styles: ["",

    Looks like the script is using these URLs to load the stylesheets. You might try changing those URLs to point at your local (modified) stylesheets. Couldn’t offer anything more without actually seeing the script.

    Tom Houy

    Good grief, yes I was just trying to blank out the domain name, lol.

    I did try replacing the paths as you mentioned, as well as the “server” URL, but for some reason it keeps loading from the original domain.

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