Solved

json not working on server in IE

Posted on 2014-01-30
3
252 Views
Last Modified: 2014-01-30
I have an ajax call that returns json from my server. On my local machine the code works in all browsers and does exactly what it should be doing. When I load it on my server. Windows 2008 R2, it works in both Chrome and Firefox, but not in IE. I can't figure out what is wrong or what the solution maybe. Any ideas?? Again it works locally just fine in IE when in debug.

 $("#<%=txtPositionTo.ClientID%>").blur(function () {
                 currentObject = $("#<%=txtPositionTo.ClientID %>").val();
                 $.ajax({
                     type: "POST",
                     url: "Data.asmx/GetToPosition",
                     data: "{PostionNumber:'" + currentObject + "'}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     success: function (data) {
                         var a = data.d;
                         a = $.parseJSON(a);
                         BindPostionTo(a);


                     },
                     error: function (xhr, ajaxOptions, thrownError) {
                         alert(xhr.status);
                         alert(thrownError);
                     }

                 });

             });

Open in new window

0
Comment
Question by:NickMalloy
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
What error are you getting?
0
 

Author Comment

by:NickMalloy
Comment Utility
None, it just returns nothing to my boxes. If I do an alert it shows multiple objects for a. It does return a lot of data, and I looked up limits for IE, but it works locally so I can't see how that is the problem.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
So the problem is occurring in the success and not in the call?
Do an hard refresh to make sure you are not using old cached versions of any js files.
Can you verify the returned data is the same as in other browsers.
Add into your ajax params

cache: false,
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article discusses how to create an extensible mechanism for linked drop downs.
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)

728 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

8 Experts available now in Live!

Get 1:1 Help Now