0

html:

<ul class="sortable">
                            <li id="1">Strona Główna</li>
                            <li id="4">Kategorie</li>
                            <li id="6">Spis Treści</li>
                            <li id="7">Współpraca</li>
                            <li id="8">Kontakt</li>
                        </ul>

I use html5sortable plugin for jquery to use sortale list. From here: http://farhadi.ir/projects/html5sortable/

When I use this script:

$('.sortable').sortable();
        $('.sortable').bind('sortupdate', function() {
                alert(1);
        });

It works perfectly, I can sort list, dragging works. And when I make change alert(1) appears.

But when I change script to this:

$('.sortable').sortable();
        $('.sortable').bind('sortupdate', function() {
                $.ajax({
                    data: data,
                    type: 'POST',
                    url: 'update-menu',
                    dataType: 'json';
                });
        });

Now I can't even drag elements, it's totaly not possible. And I can't figure out what is happening here...

1 Answer 1

1

You have a syntax error here:

                dataType: 'json';

Remove the semi-colon.

Sign up to request clarification or add additional context in comments.

1 Comment

You're welcome. Did any errors appear in the javascript console? Usually you'll see something there when you have a syntax error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.