0

I'm trying to load a script with the firebug console like this:

var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-latest.js'; //example
document.getElementsByTagName("head")[0].appendChild(script);

When I run that code the firebug console gives me the error,

Blocked loading mixed active content "http://code.jquery.com/jquery-latest.js"

Is there a way to get around that?

I don't necessarily need to load jquery. The ability to insert scripts with firebug would be useful for development.

2
  • 1
    What happens if you set script.src to "//code.jquery.com/jquery-latest.js" instead? Commented Dec 25, 2013 at 13:35
  • If the page you are on is https, then you need to match the protocol Commented Dec 25, 2013 at 13:35

4 Answers 4

1

As an alternative solution, Firebug's command line allows you to do include("http://code.jquery.com/jquery-latest.js");

(But https is a good idea in any case.)

Sign up to request clarification or add additional context in comments.

Comments

0

Mixed content suggests that you are loading your script from an external source served over http onto your page which is server over https

So, you can use this

script.src = https://code.jquery.com/jquery-latest.min.js;

Here is a related mozilla documentation.

Comments

0

For security reasons, you cannot load scripts from HTTP in an HTTPS page.

Change the script URL to HTTPS.

Comments

0

Consider the include() command, with which you can do what you want and you can even manage aliases to include your favorite scripts.

Note that by default, include() proposes the "jquery" alias to get jquery-latest. So would just have to use this command:

include("jquery")

Here is the documentation: https://getfirebug.com/wiki/index.php/Include

Florent

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.