Solved

Json Not supported error in ajax jquery

Posted on 2013-05-29
1
495 Views
Last Modified: 2013-06-25
Can someone tell me why this is running ok on my local build but not working when deployed to server. On server it generates error on page warning at bottom left hand corner, when I click to see message it tells me that JSON is not supported.

What is so different in that its coming from the server?

When I copy the entire site from server to local it runs perfect so its not a code difference.


$.ajax({
                type: "POST",
                url: "ContractsList.aspx/StoreSearch",
                data: JSON.stringify(DTO),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(result, txtstatus) {
                }
            });
0
Comment
Question by:jazz__man
1 Comment
 
LVL 4

Accepted Solution

by:
Ahmed Hussein earned 500 total points
ID: 39204831
change contetType from contentType: "application/json; charset=utf-8", to contentType: "text/json; charset=utf-8",

~AG
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now