0

I need to pass some data via AJAX POST or GET to a php file which then uses that data to

reference or access a database without actually refreshing the page. How am i to do it?

For ex: if i use:

function callFunc() { $.post ( " phpFile.php " , { name: "James"} ... ... ... }

2 Answers 2

1

Take a look at Easy Ajax with jQuery should explain things.

Sign up to request clarification or add additional context in comments.

Comments

1

When you use Ajax, an http request is made to the server that calls a php script sending post or get variables to this. The script is then executed and the response returned to the main page, with jquery you can manage the response and make the page not to refresh. If you have a HTML form and a submit button the page will be refreshed, you have to avoid this. Use jquery Val() selector to get the input values and send them trought an Ajax call without the submit button.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.