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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:58:34+00:00 2026-06-11T01:58:34+00:00

We are all familiar with the problem of mixed scheme (http / https) content

  • 0

We are all familiar with the problem of mixed scheme (http / https) content on a page.

enter image description here

I’m working on a site on which this is unavoidable. I do not want to prevent this. I know there are a ton of questions / answers on that.

What I need is simply to detect this (via JavaScript?) so I can tweak the page behavior (show a notice of degraded behavior or something). Any help?

  • 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-11T01:58:36+00:00Added an answer on June 11, 2026 at 1:58 am

    It’s hacky, but I managed to fix this in all browsers with just JavaScript. Let me see if I can sketch it out.

    We have this basic encrypted page:

    <html> 
       <body>
            <div> stuff </div>
            <iframe src="URL_WHICH_IS_MAYBE_INSECURE"></iframe>
       </body>
    </html>
    

    When URL_WHICH_IS_MAYBE_INSECURE is https, all is good. But when URL_WHICH_IS_MAYBE_INSECURE is http, IE will not load the content unless the user OK’s insecure/mixed content. I want to tell the user the page is kinda busted until they click allow. For reasons I can’t go into, I know all the sites are trustworthy. Just some of them do not support SSL and the parent site needs to.

    AFAIK, I cannot detect this dialog / semi-loaded state with JS. But what I can do is run JS over an insecure connection IF they allow it (which also makes the iframe go). So only when URL_WHICH_IS_MAYBE_INSECURE is http & the site is https (mixed) I add two bits of code + HTML.

    <html> 
       <body>
            <div> stuff </div>
            @if(needSpecialHandlingForMixedMode) {
                <div id="secureWarn">
                     WARNING: This page has limited functionality, allow mixed content
                 </div>
            }
            <iframe src="URL_WHICH_IS_MAYBE_INSECURE"></iframe>
       </body>
    
       @if (needSpecialHandlingForMixedMode)
       {
          string baseUrl = Request.Url.SchemeAndHostAndPort().Replace("https", "http");
          <script src="@baseUrl/scripts/security-warning.js"></script>
       }
    </html>
    

    and the script is

    $(document).ready(function(e) {
        $("#secureWarn").remove();
    });
    

    So it works like this.

    1. If mixed-mode both the iframe and script will only load if the user allows it. This is not allowed by default in IE and is allowed by default in Chrome & FireFox.
    2. If they do nothing (don’t allow in IE, for example), it will keep the warning div visible.
    3. If they do click it, the iframe loads, and now the script also runs (because it was insecure back to my server), this removes the warning from the page.
    4. Happiness commences…

    Hope this helps someone.

    Cheers,
    Michael

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not familiar with PowerBuilder at all. We have a problem in our
We are all familiar with working of sizeof operator in C language. I am
I'm not all that familiar with jquery so I'm not quite sure how to
I'm not all that familiar with markup. I tried to use it to test
I'm not familiar at all with JQuery and I'm not very good with CSS,
I just started to use doxygen and may not be familiar with all available
I'm learning as I go, so I'm not familiar with all of the concepts
I have a problem in silverlight which I need to convert this image(from database
I'm having a problem with a site created in Drupal 6 but not compatable
We are all familiar with relative paths: A relative path to ./images/hello.jpg from http://www.domain.com/hey

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.