Hrach Ghapantsyan
Hrach Ghapantsyan

Reputation: 699

JavaScript Buttons don't work with a HTTPS Connection

When I go to the Games section of my website, the buttons work perfectly: http://sharepanel.net/games/

When I go to the page with a Secure SSL connection, the buttons don't do anything: https://sharepanel.net/games/

Am I missing something?

This is the Javascript code for the buttons:

<script>
    function getPage(el,page){
        $(el).load(page, function(response, status, xhr) {

            if (status == "error") {
                var msg = "Error While Loading Page: ";
                $(el).html(msg + xhr.status + " - " + xhr.statusText);
            }
        });
    }

$(function(){
    $("#top10").on("click",function(){
        getPage("#main","/games/top10.php");
    });

    $("#action").on("click",function(){
        getPage("#main","action.php");
    });

    $("#adventure").on("click",function(){
        getPage("#main","adventure.php");
    });

    $("#timemanage").on("click",function(){
        getPage("#main","timemanage.php");
    });

    $("#fungames").on("click",function(){
        getPage("#main","fungames.php");
    });

    $("#newgames").on("click",function(){
        getPage("#main","newgames.php");
    });

    $("#randomgames").on("click",function(){
        getPage("#main","randomgames.php");
    });
});
</script>

Upvotes: 2

Views: 859

Answers (1)

Hrach Ghapantsyan
Hrach Ghapantsyan

Reputation: 699

Thanks for all the help guys,

I just fixed this by saving all the jQuery files to my website and replacing the urls to the jQuery code to the urls on my webserver.

Thanks Hrach

Upvotes: 1

Related Questions