jquery - When Ajax works but doesn't -


i have been scouring internet solution. don't think language specific, i'm in coldfusion using jquery ajax out cute little dialog. code works on many computers, different servers, iis , apache...but me, no. ajax calls work fine in code, if fails in call, i'm supposed see "ok" script box popup. , these calls, things see...but when dig actual call , @ ajax sending , receiving correct...well 1 thing not there reason on computer, return has preceeding whitespace in json data...no 1 else has problem...but running same code. of research points things wrong causing ajax fail...but not technically problem...ajax works fine , returns 99% of expect to. have believe there environmentally different or "outside" (at least of code) impacting results treated invalid...but again, same code works in many "elsewheres". here gist of pretty simple code:

$(document).ready(function() {     $('##viewaction').on('shown.bs.modal', function (e) {         $('##records-table').empty();         var linksource = $(e.relatedtarget);// link triggered modal         var actionid = linksource.data('action-id');         var actionname = linksource.data('action');         $.ajax({             type: "get",             datatype: 'json',             cache: false,             url: 'portal/plugins/test/ajaxproxy.cfc',             data: { method: "viewactionrecord", actionid: actionid }         })         .done(function( results ) {             response = eval(results);             $('##action-name').text(actionname);             $.each(response.data, function(i, item) {                 // undefined less object appear if value in our struct converted json blank                 // works if struct delivering flat...otherwise, objects valid                 // values here...warning future "nested" views of data                 if(typeof item =="undefined" || typeof item == "object") {                     $('<tr>').html("<td>" + + "</td><td>&nbsp;</td>").appendto('##records-table');                 } else {                     $('<tr>').html("<td>" + + "</td><td>" + item + "</td>").appendto('##records-table');                 };             });         })         .fail(function(e) {             //alert(e.responsetext);             alert(e.statustext);         });     }); }); 

and in environment...no matter how right data might appear, i'll hit .fail() segment.

now important note ajax fails me...not code. old code working last 3-4 years exhibiting same kind of response anomaly.

and gets worse...this started happening. no significant installs or updates window 8.1 , iis of aware nor significant installed software recently..all ajax calls have stopped working , can find nothing points culprit.

and if thought not possible...one more thing has happened makes me think i'm never going rid of , should pack , start flipping burgers...i had 1 of our sys-admins setup remote desktop environment me...he set baseline , copied code our repository , installed few tools (same tools other developers use) , works fine...then 1 day, literally out of blue (i know, know how many times have heard this), stops working.

i'm willing search anything, uninstall things , reinstall (blowing away not option because of remote desktop test above), install things...but life of me cannot figure out has happened create such bizarre circumstances cannot replicated others using same code , similar environments.

i'm not holding breath...but had put out here if no other reason due diligence.

-- more information --

what return?

exactly json expect, every time, except cr+lf in front of it...now idea why since same code on other boxes not produce whitespace

are using same browser? have specific error thrown @ you?

every browser, current version (ie, firefox, chrome , yes, safari) , part of problem, there no error thrown. ajax, in sample code, hitting .fail() segment of code there no error in data

what browser using??and there errors in console?

browsers answered above , no, no errors in console, solid gold successful result data in it

are using latest released jquery? if not, try newer or latest version.

went , forth version (not distributed recent), again, exact code works everywhere else it's bundled verison of jquery...and no error responses, far jquery concerned, it's happy.

is "suppress white space" cfadmin setting turned on in other environments, not local one?

absolutely disabled , stretched imagination , went cf code , make sure methods create data have output set (component , method) , json prefixing in cf admin disabled. have check related cf admin settings other servers work , same...plus...lacks explanation of why working on box , fail when none of settings changed.

and cf 10 , cf 11.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -