javascript - Ajax Jquery : Ajax function onclick wont complete or post -


i'm lose mind, have gone on documentation twice , can't understand whats it, im not able recieve alert in event of error: or success:

please tell me has ideas...

 <ul class="dropdown-menu" >                 <li><a href="#" id="restuatant"><span class="t">restaurant</span></a></li>                 <li><a href="#" value="active"> <span class="t">hair salon</span></a></li>                 <li><a href="#" value="bars"> <span class="t">bars</span></a></li>                 <li class="divider"></li>                 <li><a href="#" value="other"> <span class="t">other</span></a></li></form>src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>     <script>         $(document).ready(function(){             $('ul.dropdown-menu li').click(function(e){                $.ajax({                    type: 'post',                    data: {                        'categories': $(this).find("span.t").text(),                          }                    url: {% url 'search' %},                    success: function(data){                         alert('data submited')                                        }                    error: function(jqxhr, textstatus, errorthrown){                     alert('error');                                     }             });             </script> 

where {% url 'search' %} is:

 url(r"^loc_search/$", 'project_name.views.json_search', name="search"), 

all want pass ever option selected function in views.py file :(


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -