why ajax call url ends with #.?
$.ajax({
type:'GET',
cache: 'false',
url:"/foo/",
data:{"id": pid},
success:function(data) {
开发者_StackOverflow社区$('#wrapper').html(data);
}
});
<li id="btn-click" class="select">{{ promo.name }}</li>
Why ajax url ends with #.
Suppose My url is http://localhost:8000/foo/
then it ends with http://localhost:8000/foo/#.
I don't want to use #. at the last.
Does your anchor have a # in it so that it doesn't reload the page? If so, on your click event you will need to either return: false; or use event.stopPropagation(); to prevent the default behaviour.
What is the value of {{ promo.name }} ??
Maybe you have href="#" on the link that runs the ajax call? use href="javascript:void(0)" instead.
精彩评论