0

I am working my way through the following tutorial and everything works great except for one significant detail: When I test the page in any browser I get a warning message that content unsecure content is being blocked. Once I acknowledge the warning and choose "allow blocked content" or a similar option, it works just fine. Obviously this will be problematic if left as is and put into production.

This is the body of the .js file

$(document).ready(function () {

    $('input[type=password]')
        .keyup(function () {
            // keyup code here
        })
        .focus(function () {
            $('#pswd_info')
                .show();
        })
        .blur(function () {
            $('#pswd_info')
                .hide();
        });
});

My question is how do I implement the code so it does not throw warnings and is automatically blocked by browsers?

I look forward to your insights and expertise.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
Milo
  • 1
  • 1
  • 2
    Are you loading a script via HTTP into a HTTPS site? It hardly has to do with the content of the script file (unless your antivirus program intercepts it and check it for malicious things, which would explain the cross-browser message appearance) – Bergi Sep 11 '13 at 00:12
  • It is being called on a HTTPS site. I changed the call to src="https://mysite.com/pwd_script.js" (this editor is truncating it, but I put the entire path with https://) from src="pwd_script.js" and still no dice. – Milo Sep 11 '13 at 00:15
  • Could the issue be that the page is https and it makes a call to "http://code.jquery.com/jquery-latest.js" which is not https? If so, how do you work around that? – Milo Sep 11 '13 at 00:23
  • 1
    That as well - all ressources on a secure site need to be loaded with a secure connection otherwise the page is considered tainted. Just load [https://code.jquery.com/jquery-latest.js](https://code.jquery.com/jquery-latest.js) – Bergi Sep 11 '13 at 00:30
  • That did it, Bergi. Thanks for leading me there! – Milo Sep 11 '13 at 00:33

1 Answers1

2

I get a warning message that content unsecure content is being blocked.

You seem to be on a secure (HTTPS) site and loading your scripts via HTTP. All ressources need to be loaded with a secure connection otherwise the page would be corrupted.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375