The object does not support this property or method - jquery.min.js

I am developing a site and testing in IE 8, and I get the error "Object does not support this property or method" for ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery. min.js

This error occurs only when I am on the home page, then I click one of the rectangular icons on the right, for example, "Lawn Care". I have to highlight this word and scroll it. This is normal if I'm already on the main page.

The site works in all browsers except IE 8. Go to http://diginnovations.com/serenity to view it. Thank!

+3
source share
2 answers

JavaScript, IE 6:

<!--[if gte IE 6]>
<script type="text/javascript">
$(document).ready(function() {

    $("li").removeClass("customTarget");
    var myLocation = document.location.hash.replace("#","");
    if (myLocation) {
        document.getElementById(myLocation).className = "customTarget";
    }

    $("a").click(function () {
        $("li").removeClass("customTarget");
        var clickedLink = this.href.split("#");
        if (clickedLink.length > 1) {
            document.getElementById(clickedLink[1]).className = "customTarget";
        }
    });

});
</script>

, jQuery JavaScript. , $ undefined.

+2

( IE8), , , :

 menu = document.getElementById('limit' + i);
 menu.style.display = "block";

, :

 document.getElementById('limit' + i).style.display = "block";
0

Source: https://habr.com/ru/post/1789061/


All Articles