Does JavaScript work on SSL?

Does JavaScript work on SSL?

Discussion in 'Web Programming' started by robertdn, Feb 16, 2015.

  1. robertdn

    robertdn Moderator

    Messages:
    112
    Likes Received:
    14
    Trophy Points:
    18
    Ratings:
    +15 / 0 / -0
    Hello everybody,

    While enabling SSL on my website, I noticed that Login Control created with JavaScript no longer appeared, yet if I browse the website without SSL, the control is present.
    What am I doing wrong and how do I fix this problem?

    Thank you for your assistance.
     
    Loading...
  2. elcidofaguy

    elcidofaguy Active Member

    Messages:
    197
    Likes Received:
    84
    Trophy Points:
    28
    Ratings:
    +150 / 0 / -0
    I cant say for sure but it sounds to me that the Javascript is referencing a non secure URL i.e. non https version... I would check the code for URLs which reference your site and change them to the https version...
     
  3. ElixantTechnology

    ElixantTechnology Moderator

    Messages:
    77
    Likes Received:
    24
    Trophy Points:
    18
    Ratings:
    +35 / 0 / -0
    Be sure that your Javascript is being loaded correctly to function on both SSL and Non-SSL;

    i.e.

    Code:
    <script src="//www.domain.com/script.js"></script>
    INSTEAD OF

    Code:
    <script src="http://www.domain.com/script.js"></script>
    Be sure to do this for all images/css as well, otherwise you will be provided with a warning that there is insecure content on the website.