In my project I have a lot of Ajax methods, with external client-side scripts (I don\'t want to include JavaScript into templates!) and changing URLs is kind of pain for me
What I usually do is put the URL in either an element, or in the rel="" attribute.
Then, when writing the JS (using jQuery below) I do:
$('div#show_more').click(function () {
var url = $(this).attr('rel');
// or
var url = $('#more_url').val();
$.get(url, function () { /* ... */ });
});
Nonstandard attributes are well supported by all major browsers and hidden elements don't have to be in forms.