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

  • Home
  • SEARCH
  • 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 4013698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:24:14+00:00 2026-05-20T09:24:14+00:00

I am new to studying jquery.ajax. Through some tutorials, I tried some code by

  • 0

I am new to studying jquery.ajax. Through some tutorials, I tried some code by myself, but I met some trouble. So I ask for help.

I tried to do this: open a.php, send html data from div#send to b.php, then return the data and show in div#result.

a.php

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> 
<script language="javascript"> 
$(document).ready(function () {      
var params = "value=" + $('#send').text();   
$.ajax({        
     url:'b.php',        
     type:'post',                 
     dataType:'html',            
     data:params,                
     success:data     
     }); 
function data (html) {   
var str=html.send;   
alert(html);
$("#result").html(str); 
} 
}); 
</script>
<body>
<div id="result"></div>// I need return 'this is an apple.'
<div id="send">apple</div>

b.php

<?php
echo 'This is an '.$_REQUEST['value'].'.'; 
?>
  • 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-20T09:24:15+00:00Added an answer on May 20, 2026 at 9:24 am

    To return datas from b.php, you have to do an echo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to WordPress but have spent some 50 odd hours studying up
I just started studying C++, and I met this new guy: ->. I was
I am new in Flex Environment, specifically flex3. I've been studying it for 1
New to javascript/jquery and having a hard time with using this or $(this) to
New to both Ruby and Rails but I'm book educated by now (which apparently
New to WCF, but familiar with COM+ - can I wrap a WCF service
In new C++ code, I tend to use the C++ iostream library instead of
I am studying the new Amazon RDS product and it seems it can be
I remember the old effective approach of studying a new framework. It was always
I am new to the topic of cryptography and am studying PKI and PKCS

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.