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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:32:10+00:00 2026-05-27T14:32:10+00:00

I would like to convert this ajax function to a jquery function but im

  • 0

I would like to convert this ajax function to a jquery function but im not sure how it would be done in jquery

function ajax_posta() {
// Create our XMLHttpRequest object
    var hr = new XMLHttpRequest();
// Create some variables we need to send to our PHP file
    var url = "javas.php";


    hr.open("POST", url, true);
// Set content type header information for sending url encoded variables in the request
    hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// Access the onreadystatechange event for the XMLHttpRequest object
    hr.onreadystatechange = function () {
        if (hr.readyState == 4 && hr.status == 200) {
            var return_data = hr.responseText;
            document.getElementById('status').innerHTML = return_data;
        }
    }
// Send the data to PHP now... and wait for response to update the status div
    hr.send("num=" + (--num)); // Actually execute the request
    document.getElementById('status').innerHTML = "<img src = 'loading.gif' height =     '30'     width = '30'>";

}
$(document).ready(function()
{
    $('.eventer.button').click(function () {
        var self = this;
        $.post('javas.php', function (data) {
            $(self).parent('div').find('.status').html(data);
        })
    });
}
)
;
</script>
  • 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-27T14:32:11+00:00Added an answer on May 27, 2026 at 2:32 pm

    You’re pretty much there

    $.ajax('javas.php', {
        success: function(response) {
              $(".status").html(response);
        }, 
        data: "num=" + (--num)
    });
    

    If these are the only two pieces of data you need to send to your request, you could just use $.post, but the advantage here is that if you ever want to specify more options, like contentType, all you’d have to do is add it to the existing options object.

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

Sidebar

Related Questions

I would like to convert this string foo_utf = u'nästy chäräctörs with å and
I would like to convert this fluent approach to xml: container.Register( AllTypes.FromAssemblyNamed(Company.DataAccess) .BasedOn(typeof(IReadDao<>)).WithService.FromInterface(), AllTypes.FromAssemblyNamed(Framework.DataAccess.NHibernateProvider)
I would like to convert a yyyy-mm-dd to something like this: Saturday, 2 October
This is a similar question to this one . I would like to convert
I would like to send data using $.ajax like this: $.ajax({'url': 'my.php', 'type': 'POST',
I would like to convert this string {id:1,name:Test1},{id:2,name:Test2} to array of 2 JSON objects.
I would like to convert this SQL statement to a JPQL equivalent. SELECT *
i would like to reproduce/convert this js script to a php script, is there
i would really appreciate any help. I would like to convert this list [[{id1,1},{id2,2},{id3,3},{id4,4}],[{id1,5},{id2,6},{id3,7},{id4,8}],[...]]
Compiling on linux using gcc. I would like to convert this to hex. 10

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.