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

149
Vistas
javascript script src error 404 Not Found

I'm doing something with .net core. I have some jquery code that I use in almost every page and I want to set that specific code in one file and reuse it in others. That common code has function that shoudl be called from others files. Exactly I have some function for my modal pop up. But I'm getting this error in browser "Failed to load resource: the server responded with a status of 404 (Not Found)" My question is similar as on this link, but replies didnt help me How to add jQuery in JS file

My code in VS

@*<script src="~/js/Event/OverViewNew.js"></script>

When I put all code in one file this works*@

$(document).ready(function () {
    var script = document.createElement('script');
    script.src = "~/wwwroot/js/Event/OverViewNew.js";  //doesn't work 
    //script.src = "~/js/Event/OverViewNew.js"; doesnt work 
    script.type = 'text/javascript';
    document.head.appendChild(script);
    //document.getElementsByTagName('head')[0].appendChild(script);

    var script2 = document.createElement('script');
    script2.src = '~/wwwroot/js/Helper/Modal.js'; //doesn't work
    //script2.src = '~/js/Helper/Modal.js';  //doesn't work
    script2.type = 'text/javascript';
    document.head.appendChild(script2);
    //document.getElementsByTagName('head')[1].appendChild(script2);
});
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