0

When i click on the element <a class="page-number" href="javascript:void();">1</a> The server side code is executed without errors. At the client side i get the error Uncaught SyntaxError: Unexpected token )

The Jquery code is

$(document).ready(function () {
            $(".page-number").click(function () {
                var page = parseInt($(this).html());

                $.ajax({
                    url: '@Url.Action("ProductsList")',
                    data: { "page": page },
                    success: function (data) {
                        $("#products-list").html(data);
                    }
                });
            });
        });

What is wrong with that?

enter image description here

After trying to isolate the issue i noticed that the exception is raised within the ajax callback

enter image description here

tereško
  • 57,247
  • 24
  • 95
  • 149
OrElse
  • 9,183
  • 38
  • 134
  • 240

1 Answers1

1

The problem seems to be the void() function. It requires a parameter. Try using void(0)

Sebastianb
  • 1,930
  • 22
  • 29