Site with external Javascript

Home Forums General issues Site with external Javascript

This topic contains 11 replies, has 3 voices, and was last updated by  Mark Wolters 3 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #33947 Reply

    Marco

    Hi,
    The plug-in works really well. But how i can change one or more page in http ?

    Because if i have this script included in a https page don’t work:

    https://subdomain.domain.com/search

    the original resource is not in https. If possible exclude some pages of site form https in http ?

    have a solution for a external javascript ?

    All the best
    Marco

    #33948 Reply

    To have some pages not on SSL, you can use the per page plugin:

    Really Simple SSL per page

    #33949 Reply

    Marco

    Thanks. I consider this.

    and if you want to keep the site https and load an external resource in javascritpt ?

    How to allow this function ?

    #33955 Reply

    That is possible if the domain over which the javascript is loaded has an SSL certificate installed.

    For example you could load your jquery files from the googleapis.com server, which will work without any issues, because googleapis.com supports https.

    You can also download the file and insert it from your own site.

    #34026 Reply

    Marco

    Hi Rogier,

    this affiliation program don’t have a SSL for each domain. So unique possibility are load the javascript in http.
    Have a possibility for insert a mixed content in a single page ?

    Because the Single page plug-in is good if you don’t are a https site. But now i make all redirect 301 for a SEO and return to http is not a good solution.

    Thanks for support

    #34054 Reply

    You can exclude a url from the mixed content fixer using this article:

    How to exclude a url from the mixed content fixer

    This will cause browsers to give warnings about mixed content though. You won’t have the green lock anymore on pages with this URL.

    #34179 Reply

    Marco

    Thanks Rogier.

    It’s the same if this url are a subdomain ?

    function rsssl_exclude_http_url($html) {
    $html = str_replace(“https://subdomain.domain.com”, “http://subdomain.domain.com”, $html);
    return $html;
    }
    add_filter(“rsssl_fixer_output”,”rsssl_exclude_http_url”);

    #34186 Reply

    Yes, it’s just a string replacement actually. So if you enter abc in the first part, then def in the second, it replaces all abc strings to def.

    #47592 Reply

    Sylwester

    Hello,

    I have the same problem. I have implemented the code in functions.php, which we can see above, but javascript script is still not working. I can see now that in my soure code it is htts link, but script isn’t working. In console I see this information:

    (index):1 Mixed Content: The page at ‘…………..’ was loaded over HTTPS, but requested an insecure script ‘…………………..’. This request has been blocked; the content must be served over HTTPS.

    Rogier and Marco, do you have any idea to fix the problem? For me it’s fundamental thing :(.

    Thank You.

    #47720 Reply

    Mark Wolters
    Keymaster

    Hi,

    it looks like the javascript file is not available over https://. Can you give me the URL of your site so I can have a look?

    Mark

    #47727 Reply

    Sylwester

    Hello,

    Yes, excactly, I can’t lauch javascript over HTTPS protocol. Please, look there:

    Kalkulator: Ile wynosi RRSO Twojej pożyczki

    Thank you in advance.

    #47837 Reply

    Mark Wolters
    Keymaster

    Hi Sylwester,

    the following error occurs on your site:

    Mixed Content: The page at ‘https://www.finansepolskie.pl/kalkulatory/kalkulator-ile-wynosi-rrso-twojej-pozyczki/’ was loaded over HTTPS, but requested an insecure script ‘http://m2m.finansepolskie.pl/j/widgets/kalkulatory.js’. This request has been blocked; the content must be served over HTTPS.

    the reason this script is not loaded is because it is not available over https://. What you can do to fix this is to either ask the developer of the script if they can make it available over https://, or host the script on yourself so we know for sure it’s available over https://.

    Mark

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Site with external Javascript
Your information: