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

137
Visualizações
ASP Classic include file using AJAX

I have a Bootstrap nav and I would like to change de content of the #result div using the Include.File from ASP Classic on click. Is there a way to do this?

HTML

<body onload="">
    <nav class="navbar navbar-light bg-light sticky-top shadow">
         span><%=rs(2)%></span>
                
         <ul class="nav nav-pills ml-4">
              <li class="nav-item">
                  <a class="nav-link" style="cursor: pointer;" id="solicitar" onclick="test('solicitar.asp')">Solicitar</a>
              </li>
              <li class="nav-item">
                  <a class="nav-link" style="cursor: pointer;" id="consultar" onclick="test('consultar.asp')">Consultar</a>
              </li>
         </ul>

         <a class="navbar-brand mx-auto" href="">
             <img src="../imgs/logos/4_COL-1.jpg" width="200" height="50" class="d-inline-block align-top" alt="">
         </a>

         <span><%=date%></span>
   </nav>

   <div class="container-fluid" id="result">
                
   </div>
</body>

JavaScript

function test(fileName) {
  $.ajax({
    method: "POST",
    data: {},
    success: function () {
      $("#result").html('<!--#Include File="' + fileName + '"-->');
    },
    error: function (x) {
      console.log(x);
    },
  });
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

To request a page via ajax you set the url parameter to the address of the page.
If successful you will get the page contents in the success function.
Used GET instead of POST since it was just a page request.

function test(fileName) {
  $.ajax({
    url: fileName,
    method: "GET",
    success: function (html) {
      $("#result").html(html);
    },
    error: function (x) {
      console.log(x);
    },
  });
}
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