Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 125649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:11:33+00:00 2026-05-11T05:11:33+00:00

jQuery return links are not working. I have Used jQuery and the basic Ajax

  • 0

jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file Links_ajax.php.

I giving the code samples.

GetCustomerData.php has:

<html>     <script type='text/javascript'>     <script src='ajax.js' type='text/javascript'>          $(function() {             .....              $.ajax({                 type: 'POST',                 url: 'Links_ajax.php',                 data: 'category='+category  ,                 success: function(data){                     $('#response').html(data);                 }             });         }         ......     }      ...      <! Links return here         <div id='response'>         </div> </html>  <?   echo 'Some Code';   ?>    .... 

My Links_ajax.php has the following code

....  echo '<a href='getCustomerData.php?id=10' onclick='requestCustomerInfo();return false;'>show me </a>'; echo '<a href='getCustomerData.php?id=11' onclick='requestCustomerInfo();return false;'>show me </a>';  .... 

Now I come to the Main Page getCustomerData.php. I have used the Ajax feature that returns link from Links_ajax.php.

 ..... 

So, my ajax.js has the following Ajax scripts.

var url = 'GetCustomerData.php?id='; // The server-side script function handleHttpResponse() {     if (http.readyState == 4) {         if (http.status == 200) {             var results = http.responseText;             document.getElementById('divCustomerInfo').innerHTML = results;         }     } }  function requestCustomerInfo(event) {     if(event &&event.preventDefault) event.preventDefault();     else if (window.event && window.event.returnValue)         window.eventReturnValue = false;         var sId = 10;         http.open('GET', url + escape(sId), true);         http.onreadystatechange = handleHttpResponse;         http.send(null);     }      function getHTTPObject() {         var xmlhttp;          if (window.XMLHttpRequest){             xmlhttp = new XMLHttpRequest();         }         else if (window.ActiveXObject){             xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');             if (!xmlhttp){                 xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');             }         }         return xmlhttp;     }      var http = getHTTPObject(); // We create the HTTP object 

……

Now I come to the problem. When I execute the GetCustomerdata.php, I am able to get all the links from ajax.JQuery. And upon clicking that, I need a basic Ajax feature since loading the same <div> </div>. But I am unable to view it even though I done. Is there anything wrong in my code? Or do I have to use any other feature?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:11:33+00:00Added an answer on May 11, 2026 at 5:11 am

    First i wonder why you write a custom function HTTPrequest while you already have jquery object, infact you already use $.ajax at the top but then create getHTTPObject() later.

    The problem is the javascript function requestCustomerInfo() never delegate to handle the link at the ajax response data, you need to delegate the function as a callback of the ajax request

    $.ajax({        type:'POST',        url: 'Links_ajax.php',        dataType: 'html',        data:'category='+category,        success: function(data){            $('#response').html(data);            // here add the link click handler            $('#response a').click(function(){                 // make http get request & custom handler                 $.get('GetCustomerData.php?id=10',function(result){                     $('#divCustomerInfo').html(result);                 }); return false;             });        } }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer So it creates instances of the Name and Address objects… May 11, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer I figured my problem here. I had a class named… May 11, 2026 at 11:47 pm
  • Editorial Team
    Editorial Team added an answer The first is more efficient than the second. del foo.bar… May 11, 2026 at 11:47 pm

Related Questions

I have a JavaScript function that is not working now that I put in
I've got a grid which provides some links for users to download files. Files
I have an unordered list with mouseover and mouseout events attached to the li
This seems so tricky to me that I think I am overlooking something simple

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.