Site locking on specific pages

1

I have few functions on this site, but I believe some jQuery is doing the following page hang.

The scripts are basically:

    <script>
    $(document).ready(function () {
        $('.contato').hide();
    });

    function mostrar(contato) {
        $('#' + contato).slideToggle();
    }
</script>


<script>
var num = 50; // tanto de scroll que vai precisar para a barra ficar fixa.
$('.navbar-fixed-top').css('top', 150);
$('.ajusteMenu').css('margin-top', 55)
$(window).bind('scroll', function () {
    if ($(window).scrollTop() > num) {
        $('.navbar-fixed-top').css('top', 20);
    } else {
        //Quando o menu ficar fixo
        $('.navbar-fixed-top').css('top', 150);
    }
});
</script>

What might be causing this crash? Even the preview element takes time to open.

    
asked by anonymous 17.06.2015 / 22:05

3 answers

0

Despite all the valid comments about how the site was developed, that was not the problem.

The site had undergone a SQL Injection.

    
22.06.2015 / 04:34
5

Actually, your site is poorly developed, you have to open and close tags, put things in the right places and the error has nothing to do with jquery, it has to do with good development practices that you are not following. >

I evaluated your site with this amazing google tool ( PageSpeed Insights ), from 0 to 100, the google of note 9 (mobile) and 11 (desktop) for this page in question, that you put the link ai, this is horrible for the user because it spends a lot of band of his internet.

Do some basic things:

  • Put the scripts and jquery at the bottom of the page, before.
  • Use the minimum possible of jquery scripts, or put all of them in a single minified file and include them in the page.
  • Compress your scripts and if possible html.
  • Work the images, they are too heavy.
  • look at F12 the things that are missing on the page, this slows down the loading of the site, since until it sees that they do not exist, it keeps calling them, like none.js, icon and more things on your page.
  • Youcall02timesthesamescriptsandnoneis.mincallsalluncompressed,thisisnotgood,notethatbootstrap.jsiscalled02times,onlyonthispage.

    <scriptsrc="/Content/js/jquery-1.10.2.js"></script>
    <script src="/Content/js/bootstrap.js"></script>
    <link href="/Content/css/bootstrap.css" rel="stylesheet" />
    <link href="/Content/css/business-casual.css" rel="stylesheet" />
    <link href="/Content/css/quadradoCursos.css" rel="stylesheet" />
    <link href="/Content/css/theme.css" rel="stylesheet" />
    <link href="/Content/css/style.css" rel="stylesheet" />
    <link href="/Content/css/socialIcons.css" rel="stylesheet" />
    <link href="/Content/css/palestrantes.css" rel="stylesheet" />
    <link href="/Content/js/bootstrap.js" rel="stylesheet" />
    

    Please review all the code and open and close the tags correctly, use jquery .min and bootstrap .min files and explore the bootstrap potential that has made your site light and usable!

        
    17.06.2015 / 22:14
    3

    Paulo Roberto's answer is impeccable; you must +1, accept, and follow her advice.

    Having said that, part of the problem (that PageSpeed Insights can not get because it does not do OCR) is that you are using images to represent what is, fundamentally, text. You should strongly consider placing these images as text on the page: so you reduce the size of your page and do not need to repeat the content of the image in alt="…" only for Google to index you.

    If your client makes a point about a cute font in the banner of each course, you can use a webfont - Typekit , have several options at affordable prices, and if the customer does not release the money, you can choose a font from the Google Web Fonts .

        
    17.06.2015 / 22:47