</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming" dir="ltr">What is the difference between client-side and server-side programming?</a>
<span class="question-originals-answer-count">
(4 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2017-06-27 13:25:06Z" class="relativetime">2 years ago</span>.</div>
</div>
</aside>
I need to call a couple small PHP functions that should execute after the user makes changes in the DOM. I know this can be done by capturing the change in jquery, then pointing an ajax call to a separate script with the function inside it; but having a few of these small functions I would rather not make a file for each, if possible. As such, is there a way to include the PHP code directly within the ajax call and not go to a separate url?
EDIT 1
Assuming a post request is being made, something like the following is what I'd like to do:
$("select").change(function() {
$.post("<?php ... ?>", {option: $(this).val()}, function(return) {
//do stuff with results
}
});
</div>