Someone, ( @Denis ) helped me figure out this much, but I do not quite understand what load() really achieves or why the reference to “some_html” is done.
I think that Denis meant this to be the python code to load the site originally, as I understand it.
def some_html():
return render('my_template.tpl')
And this is the script which calls back python to get more data and it baffles me somewhat.
<script type="text/javascript">
$('#result_from_server').load('/some_html');
</script>
What I can’t seem to understand is why the reference to the original Python method “/some_html” ? I would expect a reference to a new method in python, one which specializes in replying to that call from javascript.
The DIV with id=” result_from_server ” I guess will act as a pseudo variable or container in HTML to receive the result. That is fairly clear, I think.
<div id="result_from_server"></div>
If anyone can help me understand how this request works I would appreciate it. I do understand that different types of data can be passed back from python. But I see no typing of any kind. I assume that means that this snippet is for passing text, then.
'/some_html'does not reference a Python method. It is as ignorant of Python as I am! In this case, it is the URL for the jQuery’s ajax call (theloadmethod). I assume that your Python code’s end result is mapping a code template to a URL.