66
votes
4answers
40k views

jQuery single quote in JSON response

I'm making requests to my server using jQuery.post() and my server is returning JSON objects (like { "var": "value", ... }. However, if any of the values contains a single quote (properly escaped like ...
40
votes
1answer
29k views

Easiest way to create a cascade dropdown in ASP.NET MVC 3 with C#

I want to create two dropdown lists in a cascade using MVC3 (preferably Razor) with C#. I would like to have one dropdown where you can choose the year and another one where you can choose a specific ...
36
votes
1answer
14k views

ASP.NET MVC 2 - Failed with jquery ajax response

I do not understand this error, do not generate error in "JsonResult Test ()", I am doing other projects as ASP.NET MVC Thanks Error: System.InvalidOperationException: This request has been blocked ...
30
votes
8answers
47k views

jquery ajax request failing in IE

The following ajax call is failing in IE. $.ajax({ url:"{{SITE_URL}}/content/twitter.json", dataType:"json", error:function(xhr, status, errorThrown) { ...
30
votes
6answers
47k views

Problems with jQuery getJSON using local files in Chrome

I have a very simple test page that uses XHR requests with jQuery's $.getJSON and $.ajax methods. The same page works in some situations and not in others. Specificially, it doesn't work in Chrome on ...
15
votes
1answer
9k views

asp.net web forms json return result

I use asp.net and web forms. In my project I have asmx web service [WebMethod] public string GetSomething() { // avoid circual reference(parent child) List<RetUsers> res = ...
12
votes
2answers
202 views

Form within a form and a JSON call

In my page I have a form: <form method="post" id="confirm-order-form" name="confirm-order-form"> Inside the form I have written some scripts to make a JSON call: <script ...
11
votes
2answers
23k views

Cannot set content-type to 'application/json' in jQuery.ajax

When I have this code $.ajax({ type: 'POST', //contentType: "application/json", url: 'http://localhost:16329/Hello', data: { name: 'norm' }, dataType: 'json' }); in Fiddler I ...
11
votes
1answer
15k views

Sending JSON to WCF Rest Service - object is always null

I am trying to get my application working by using REST, WCF and JSON (new to all those technologies). I have the 'GET' working fine. It is the 'POST' that is causing me problems. As you will see ...
10
votes
8answers
10k views

jQuery 1.5 AJAX call fails with “invalid label” for JSON requests

I've just upgraded from version 1.4 to version 1.5 of jQuery, and now my AJAX calls always fail with the "invalid label" error. An example request is: jQuery.ajax({ async: false , dataType: ...
10
votes
4answers
35k views

Parse JSON from JQuery.ajax success data

I am having trouble getting the contents of JSON object from a JQery.ajax call. My call: $('#Search').click(function () { var query = $('#query').valueOf(); $.ajax({ url: ...
9
votes
5answers
27k views

Using jQuery to get json data returns invalid label error

I have this code, and have also tried something similar using the $.getJson function: jQuery(document).ready(function(){ var kiva_url = "http://api.kivaws.org/v1/loans/newest.json"; ...
9
votes
3answers
2k views

Client-side templating frameworks to streamline using jQuery with REST/JSON

I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate ...
8
votes
1answer
2k views

How to return correct response on error in ASP.NET MVC 3.0 via JSON?

I'm struggling to resolve this problem. On my local machine (Win7/VS2010/IIS 7.5) and another identical developer's machine, the following code returns the 500 status code, and the response text says ...
7
votes
1answer
15k views

PHP returning JSON to JQUERY AJAX CALL

I am still struggling to get my head around the ins and out of JQUERY, AJAX and PHP. I can now call the PHP OK, process the form elements and send an email, but I am not handling the return to the ...

1 2 3 4 5 74
15 30 50 per page