Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:41:04+00:00 2026-06-06T13:41:04+00:00

The ajax feature is on route http://mysite/playlist-edit/3 Javascript: $(#applySort).click(function(){ var list = $(#sortable).sortable(‘toArray’); $.post({

  • 0

The ajax feature is on route http://mysite/playlist-edit/3

Javascript:

    $("#applySort").click(function(){
        var list = $("#sortable").sortable('toArray');

        $.post({
                type: 'POST',
                url: " {{ path('save_sorting', { 'id' : customer.id}) }} ",
                data: { "list" : JSON.stringify(list) },
                success: function(data) {
                    alert("success");
                }
        });
        return false;
    });

Route:

save_sorting:
    pattern: /save-sorting/{id}
    defaults: { _controller: SomeApiBundle:Customer:applySorting}
    requirements:
       _method: POST

Controller action (empty):

private function applySortingAction($id){

}

Error:

POST http://mysite/playlist-edit/%5Bobject%20Object%5D 500 Internal Server Error

As you can see in the javascript code http://mysite/playlist-edit/%5Bobject%20Object%5D is actually not the url in the javascript, it should be http://mysite/save-sorting/3.

Jquery seems to call the wrong url.

Request-Header
Accept  */*
Accept-Encoding gzip, deflate
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection  keep-alive
Cookie  PHPSESSID=rkdre4frkoidgo3n1hsi4th7v5
DNT 1
Host    gartenfernsehen
Referer  http://mysite/playlist-edit/3
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
X-Requested-With    XMLHttpRequest

Response-Header
Connection  close
Content-Length  0
Content-Type    text/html
Date    Mon, 25 Jun 2012 06:21:07 GMT
Server  Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By    PHP/5.3.8

Any ideas why I get this error? I notices that http://mysite/playlist-edit/%5Bobject%20Object%5D is actually wrong but I dont know how this is created.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:41:06+00:00Added an answer on June 6, 2026 at 1:41 pm

    I did not expect this. But I changed $.post to $.ajax and now the right url is requested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ajax tutorial on w3school at http://www.w3schools.com/ajax/ajax_database.asp In this function (function GetXmlHttpObject()), it creates a
I'm doing an AJAX call using jQuery's JSON feature. function get_words_json(address, username, paging_value) {
Hello I have a feature that makes me the click function, and so far
I have a simple jsp/servlet application and I want to add AJAX feature to
I'm trying to implement the HTML5 history feature to perform AJAX loading of page
I added a new feature to a site recently, which uses AJAX to load
I would like to use the HTML5 window.history feature to implement full AJAX navigation
I'm using jQuery. I have website feature that does an ajax search and returns
I need to use ajax feature to load an external div element (an external
I'm currently developing an ajax application and I'm looking for a feature that lets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.