Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda