Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!