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

  • Home
  • SEARCH
  • 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 6133441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:13:44+00:00 2026-05-23T17:13:44+00:00

I have this simple jQuery ajax post to a Pyramid webapp. Ajax call: $.ajax({

  • 0

I have this simple jQuery ajax post to a Pyramid webapp.

Ajax call:

$.ajax({
     type: 'POST',
     url: 'http://localhost:6543/test',
     dataType: 'json',
     data: JSON.stringify({"username":"demo","email":"demo@something.com","Password":"1234"}),
     success: function (response) {
        alert(response);
     },
     error: function (msg) {
         alert("error");
     }
});

Pyramid Route:

config.add_route('test', 'test')
config.add_view('tagzu.views.test', route_name='test', renderer='json')

Pyramid view:

def test(request):
    return {'content':'Hello!'}

now when I call the service, I am sending this

Request:

POST /test HTTP/1.1
Host: localhost:6543
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 66
Origin: null
Pragma: no-cache
Cache-Control: no-cache

{"username":"demo","email":"demo@something.com","Password":"1234"}

and I get this reponse:

HTTP/1.0 200 OK
Server: PasteWSGIServer/0.5 Python/2.7.1
Date: Fri, 08 Jul 2011 01:42:33 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 21

{"content": "Hello!"}

Problem is:

the ajax success handler is never been called.
Only the error handler keeps firing with an error
msg.statusText = ‘error’

Please let me know what if I am missing something.
thanks

  • 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-05-23T17:13:46+00:00Added an answer on May 23, 2026 at 5:13 pm

    For however is encountering the same issue as me, ie. not having enough sleep!!

    For the sake of God make sure the html is on the same server, as this happens because of calling across domains of course, the html with jQuery is just a local file, the service is served on localhost.

    So the server was rejecting the query without any error details to point me in the right direction.

    Cross-domain was the last thing I would have thought of, being too focused on Pyramid, I thought it might be doing something funny.
    Funny me, for wasting so much time.

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

Sidebar

Related Questions

Let's say I'm sending this simple ajax request (jquery): $.ajax({ type: 'POST', url: '/ajax/requestForm.php',
I have this simple function: <script type=text/javascript> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); });
I'm new to jQuery so this may be a real simple answer. I have
i have this simple type from an external webservice: <xsd:element name=card_number maxOccurs=1 minOccurs=1> <xsd:simpleType>
I have this simple test project just to test the IncludeExceptionDetailInFaults behavior. public class
I've been trying to get this really simple example of using AJAX with JQuery
I have created an Ajax enabled WCF web service that contains this simple method:
I have a simple form to submit and test ajax,but it doesn't work and
I have a very simple jQuery/ajax script for a membership driven website. The script
i have problems with ajax requests and simple <input type=submit/> . i use to

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.