Solved

json not working on server in IE

Posted on 2014-01-30
3
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39822259
What error are you getting?
0
 

Author Comment

by:NickMalloy
ID: 39822301
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
ID: 39822325
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)

726 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