Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {path: '/news*', callbacks: function() {
- //alert('callback');
- var
- button = $("#news-add-more")
- , offsetCurrent = 10
- ;
- if (button.size() == 0) {
- return;
- }
- button.on('click', $.proxy(onClickButton, null/*, param1, param2*/));
- function onClickButton(/*param1, param2, */ev){
- $.ajax({
- type: 'post',
- url: '/ajax/news-add-more',
- data: {offsetCurrent: offsetCurrent},
- success: function(){
- //alert('ajax succes');
- },
- complete: function(xhr){
- //alert('ajax complete');
- //alert(xhr.responseText);
- //console.log(xhr.responseText);
- //$("#news-add-more-div").append(xhr.responseText);
- $("#news-add-more-div").parent().before(xhr.responseText);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- //console.log(textStatus, errorThrown);
- }
- });
- //alert('click');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement