I've started to use a new pattern to pass template variables to JavaScript .. It's wonderful.
Bad:
<div id="some-div"></div>
<script type="text/javascript">
$(function(){
$('#some-div').load('{% url my-ajax-view %}');
})
</script>
Good:
<div id="some-div" data-ajax-url="{% url my-ajax-view %}"></div>
<script type="text/javascript">
$(function(){
var url = $('#some-div').data('ajax-url')l
$('#some-div').load(url);
})
</script>
Now you can put that js where it belong; in a separate file.
Thank you for the useful information. Do you use Twitter? I'd like to follow you if that would be o . k. I'm enjoying your site and look forward to new up-dates. Nelia from under cabinet tv guide and vhs to dvd converter guide.
nice post,thanks for sharing! BTW,check out my new android 4.0 tablet
nice post,thanks for sharing! BTW,check out my new android 4.0 tablet novo 7.