Ian Jarvis
Ian Jarvis

Reputation: 1

use php to get value of jquery div

I've a div <div id="single-home-container"></div> that displays a value from a jquery script. Can I use php to get that value so I can pass it into a mysql query? Thanks

Upvotes: 0

Views: 290

Answers (2)

Florian Margaine
Florian Margaine

Reputation: 60777

You should definitely take some time to learn the concept of AJAX before trying to use it.

Upvotes: 0

Florian Rachor
Florian Rachor

Reputation: 1574

yes this is called AJAX. There are all kinds of AJAX functions in jQuery, in your case I think post would work great. This is the standard example from the jQuery doc:

$.post('ajax/test.php', $('#single-home-container').html(), function(data) {
  $('.result').html(data);
});

Take a look here.

Upvotes: 1

Related Questions