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
  • 58,060
  • 25
  • 98
  • 150
OrElse
  • 9,709
  • 39
  • 140
  • 253

1 Answers1

1

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

Sebastianb
  • 2,020
  • 22
  • 31