Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

288
Visualizações
Trying to use script tag for video player, page source isn't showing the code loaded

This is really strange and I've never encountered it before. I have a javascript script tag that I'm using on one of my xenforo pages, but it's not showing up so I commented it out for testing. Here's what's weird:

When I comment the code, view page source shows the code as commented, but when I go to uncomment it again then page source shows no trace of it and it's just removed.

Has anyone ever experienced this? This is the only javascript tag I can see that's doing this, but I can add anything else in its place and it shows properly, but given the fact that it shows when commented I just can't seem to figure out what's going on.

Does this sound familiar to anyone?

UPDATE: adding code

<head>
<script type="text/javascript">
    console.log('test function')
    </script>
  
    <script type="text/javascript">
    (function(){
console.log('in function now');
        var site_id = 0000;
        var data_site_id = 0;

        var sn_cb = new Date().getMonth();
        var snack_hb = document.createElement('script');
        snack_hb.src = 'https://cdn-header-bidding.snack-media.com/assets/js/snack-loader/'+site_id+'?cb='+sn_cb;
        snack_hb.id = 'snack_ads';
        if(data_site_id){
            snack_hb.setAttribute('data-site-id',data_site_id);
        }
        console.log(snack_hb);
        document.body.appendChild(snack_hb);
        snack_hb.onerror = function(){
            document.body.removeChild(snack_hb);
            var snack_hb2 = document.createElement('script');
            snack_hb2.src = 'https://cdn2-header-bidding.snack-media.com/assets/js/snack-loader/'+site_id+'?cb='+sn_cb;
            snack_hb2.id = 'snack_ads';
            if(data_site_id){
                snack_hb2.setAttribute('data-site-id',data_site_id);
            }
            document.body.appendChild(snack_hb2);
        };
    })();
</script>
</head>

If I run this, then I see the 'test function' print in console, but the script below it literally doesn't exist on the page

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda