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

134
Visualizações
JSP Script Tag usage in remote production server which has no internet connection

I am working with a dynamic web project, where some of my JSP files need to use Jquery scripts.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

As seen in the above tags, i use absolute URLs that points to scripts from web(googleapis site). I use the jquery scripts mainly to achieve autocomplete feature for one of the fields. The relevant js file for autocomplete is as follows

<script type="text/javascript" src="resources/script/jquery.autocomplete.js"></script>

As seen in the above tag, the script src is relative URL, where i have already downloaded the script from the web(https://pengoworks.com/workshop/jquery/lib/jquery.autocomplete.js)

My questions are,

  1. Will the absolute URLs in the scripts tag (referring jquery.min.js and jquery-ui.min.js) work perfectly and serves it purpose when my web application is deployed as .war file into the production server remote, where there is no internet ?

  2. I also tried downloading the jquery.min.js and jquery-ui.min.js into my relative folder paths resources/script, and gave the script tag as

    <script type="text/javascript" src="resources/script/jquery.min.js"></script>
    

But this is throwing the error in chrome's developer console as below

> jquery.autocomplete.js:257 Uncaught TypeError: Cannot read property 'msie' of undefined
    at receiveData (jquery.autocomplete.js:257)
    at Object.success (jquery.autocomplete.js:329)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at y (jquery.min.js:4)
    at XMLHttpRequest.c (jquery.min.js:4)
  1. Is there any restriction that makes such jquery scripts will work only when it is referred from its absolute source? but not when i download it to local folder ?

Suggestions for best practices in these cases, is also welcome.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

  • If you include ALL the jQuery files in the war, your relative URLs should work offline

  • Your jQuery is ANCIENT

  • The pengoworks autocomplete is using $.browser.msie which has been removed from jQuery - but it should still be there in 1.3

This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.

  • You can add it back using a $.browser polyfill or remove it by using another autocomplete

  • Since you use jquery.ui, you have one available: https://jqueryui.com/autocomplete/

I recommend

  • get rid of the pengoworks
  • update your jQuery to 3.6 and ui to 1.12
  • use the autcomplete from jQuery.ui if you are using other parts of jQuery.ui, if not, perhaps find a newer autofill
  • download and include ALL files used by the project
about 4 years ago · Juan Pablo Isaza Relatório
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