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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:05:32+00:00 2026-05-18T09:05:32+00:00

Can any one please explain this: var js_var = ‘hello’; $.ajax({ type: POST, url:

  • 0

Can any one please explain this:

var js_var = 'hello';
$.ajax({
   type: "POST",
   url: "some.php",
   data: "js_var="+js_var,
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });

I need to know what is returned by the PHP file in this case… The PHP file can be assumed to return whether jsvar exists in the db or not…

  • 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-18T09:05:32+00:00Added an answer on May 18, 2026 at 9:05 am

    Assuming that this is in reference to PHP Javascript variable help then some.php can do whatever you need to do. The actual some.php was just a place holder for whatever script you needed run was named.

    Instead of the output of that PHP file being sent and rendered in browser, it is sent and put into the msg variable. What you send back could be a block of HTML to be shoved into a div for rendering, a simple OK, or a JSON object, or XML. As you are writing the code on both ends of the communication, you can do whatever you want.

    For example, if you were creating a user creation form, you could have a script, that after the user name box loses focus, goes and makes an AJAX call, then returns either OK or an error message, then you could display that next to the user name box.

    EDIT:

    As other people have mentioned, it would be best going through a few tutorials about jQuery and AJAX in general. A quick google turns up a few decent ones:

    http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
    http://www.ibm.com/developerworks/library/x-ajaxjquery.html
    http://www.ibm.com/developerworks/opensource/library/os-php-jquery-ajax/index.html

    I’ve found that the IBM developerworks articles to be rather clear and concise time and again.

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

Sidebar

Related Questions

Can any one Give the example for Boolean_conversions Using reinterpret_cast<> Iam getting the execution
anyone can explain how to use for...in statement in javascript. I had read the
I've tried using this to login to the sorenson 360 API: error_reporting(E_ALL); ini_set(display_errors, 1);
ECMAScript is pretty straightforward about var . If you don't use var inside a
I have The Following Javascript Error Line 2 Character 1 coming in the entire
Have a regex: .*? (rule1|rule2) (?:(rule1|rule2)|[^}])* (It's designed to parse CSS files, and the
I have the following files. foo.h (C++ header file) foo.mm (C++ file) test_viewcontroller.h (objective
I'm using Haxe to make a few simple SWFs for RTMP video streaming. Everything
ive recently installed apache2 on my Ubuntu machine and have a few questions about

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.