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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:44:40+00:00 2026-06-18T03:44:40+00:00

My wish is to send some information in a datastring through AJAX to a

  • 0

My wish is to send some information in a datastring through AJAX to a PHP page and then return variables for me to separate and ask jQuery to fill out in different elements. So that it would be able for me to just say:

$('.elemA').html($variableA);
$('.elemB').html($variableB); etc.

But I am not sure if it is possible or how to do it.. Maybe it can return an array for me to separate somehow? I don’t know.


If anyone else finds this question – this script helped me out and actually showed me the meaning of the JSON encoding: http://www.jonsuh.com/demo/jquery-ajax-call-to-php-script-with-json-return

  • 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-06-18T03:44:44+00:00Added an answer on June 18, 2026 at 3:44 am

    You should use json_encode($array). Which uses JSON to encode your array and return a data string that can be read easily by Javascript.

    To convert it to a Javascript array you can use parseJSON()
    or as suggested by @BishopZ use JSON.parse(ajaxResponse), which is built in most modern browsers.

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

Sidebar

Related Questions

i wish to send some data as array from my iphone app to server
I have a web application where I wish to send information to a database.
After a user enters data on my home page, I wish to send the
Currently I'm able to send some form data from an HTML page to a
In some circumstances I wish to send an error message from a server to
I need to perform an ajax request to send some data server-side every time
I wish to send some components to my customers. The reasons I want to
I wish to load some additional data from javascript in an HTML page. The
I wish to send an email from my localhost machine (using PHPs mail function)
I wish to send text between processes. I have found lots of examples of

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.