I'm not sure if this is what you are looking for, but maybe this question (How to implement a minimal server for AJAX in Python?) is helpful. In my answer I give a minimal example (which is not very well written, for example I would now use jquery...).
Edit: As requested by the OP, here is an example for the frontend with JQuery. Note that I'm no expert on this, so there might be issues. This example is supposed to work with a JSON-RPC backend, like this one.
<html>
<head>
<title>JSON-RPC test</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript">
function test_button() {
var data = $("[name=test_text]").val();
var json_object = {"method": "power",
"params": [parseInt(data), 3],
"id": "test_button"};
var json_string = JSON.stringify(json_object);
$.post("frontend.html", json_string, test_callback, "json")
}
function test_callback(json_object) {
$("#test_result").text(json_object.result.toString());
}
</script>
</head>
<body>
<input type="text" name="test_text" value="2" size="4">
** 3 =
<span id="test_result">0</span>
<input type=button onClick="test_button();" value="calc" title="calculate value">
</body>
</html>