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 781079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:10:37+00:00 2026-05-14T20:10:37+00:00

I am using jquery ajax $.get which calls a php script on my server

  • 0

I am using jquery ajax $.get which calls a php script on my server and retrieves content from another site (domain). It return’s the full web page ok. I then want to extract html data from the ‘center’ tag using the .find() method, but I am having some issues.

$("#btnGetData").click(function(){
  $.get("pgiproxy.php",{ data: $("#formdata").serialize() },
    function(result) {

      alert($(result).find('center').html()); 

      val = $(result).find('center').html();
      alert(val);

      $('#BFX').html(result);
      alert( $('#BFX').find('center').html() );  

    });
});

The first 2 methods both return ‘null’, but when I insert the (‘result’) html into the #BFX div it displays correctly on my monitor, the final alert works correctly, it find()s the ‘center’ tag and displays the html data in the alert.

Can anybody see why I get ‘null’ returned (as in the first 2 alerts) when trying to ‘find()’ the ‘center’ tag from the returned ajax data ‘result’.

Any help is appreciated

Nic.

  • 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. Editorial Team
    Editorial Team
    2026-05-14T20:10:37+00:00Added an answer on May 14, 2026 at 8:10 pm

    you should try this:

    $("#btnGetData").click(function(){
      $.get("pgiproxy.php",{ data: $("#formdata").serialize() },
        function(result) {
          var temp = $('<div/>').html(result);
    
          alert(temp.find('center').html()); 
    
          val = temp.find('center').html();
          alert(val);
    
          $('#BFX').html(result);
          alert( $('#BFX').find('center').html() );  
    
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My jQuery code (using ajax) request's data from a local php script (pgiproxy.php). This
I made a chrome extension which calls jQuery's ajax method: content-script.js [...] $.ajax({ url:
I'm using a jQuery ajax call to get several entries from a large set
I am executing an AJAX request using jQuery as such: $.get({ url: 'run_program.php', data:
I'm using an ajax call to call a php script which waits 40 seconds
I have a Fundamental question in using Jquery with PHP when making ajax calls
I'm using jquery to make ajax calls to a database which displays the returned
I am trying to get a piece of data back using jQuery ajax via
I am using jQuery to do an AJAX POST, but get a CSRF error.
I am using JQUERY .ajax() to send serialized form data to MySQL using PHP.

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.