When making an AJAX call on MS Edge, the response data variable unexpectedly populates with source code instead of the server's sent data

I've encountered a bizarre issue that seems to be exclusive to MS Edge and affects only certain users at one particular client. When making an ajax call to the server, instead of receiving the expected response data, it appears that some source code from the platform is being stored in the variable. The code snippet provided below illustrates this strange behavior. What could possibly be causing this? We're unable to replicate the issue ourselves, but we can conduct screen sharing sessions with affected users to confirm the problem.

Here's the Ajax code:

        console.log("Calling: " + api);
        $.ajax({
            url: api,
            cache: true,
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                displayExceptionNotification("Error on call to " + api + ": " + errorThrown);
            }
        }).then(function (theData) {
// Process the server response
}

Instead of receiving the JSON data as expected, the 'theData' variable seems to contain the content of an unrelated .js file. This observation is made possible by remotely viewing/sharing the screen with the user and using the inspect/debug tool to hover over 'theData' value - reference the attached screenshot. It's puzzling why this strange inconsistency is occurring, as the subsequent code execution expects JSON but receives raw JavaScript source code, leading to failures.

Any insights?

https://i.sstatic.net/2famYr9M.png

Answer №1

To troubleshoot, try clearing your browser cache or testing in Edge's InPrivate window to check if the issue persists.

InPrivate mode differs from normal browsing as it does not retain any cache or cookies. This could indicate that the source code is being pulled from the browser cache, although it remains unclear how it is ending up in the response data.

For more information on private browsing, visit this link.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Are there any CSS hacks available to address the combination of position: sticky and overflow within the parent element?

I've encountered a sticky position issue when the overflow property is set to auto on a parent element. I've tried various solutions like adding an extra wrapper or using clip instead of auto, but none have worked. While I did find a solution usi ...

The Vue template syntax utilizes double curly braces for incrementing values within must

Embarked on learning Vue.js recently and I am intrigued by the unusual behavior in my simple code. I cannot seem to figure out what is going wrong. I am attempting to increment a counter inside mustache syntax, but something strange is happening with this ...

Is it possible to use both parameters and callback functions in the MongoDB update() function in tandem?

I am looking to create a custom callback function that will check the success of the update() process and return a Q promise based on the outcome. var myCustomFunction = function (name, email) { var deferred = Q.defer(); MongoClient.connect(mongodbU ...

Incorporating the latest version of SMINT into your Shopify store

Appreciate the help you're about to give. Here's the process of incorporating Smint v3.0 into Shopify: Added jquery.min.js and jquery.smint.js to asset files Inserted the following code within the tag of theme.liquid {{ 'jquery.mi ...

Calculate the variance between two variables

I am facing a challenge where I have an object and the 'Hours' field is saved as a string. I am looking to convert this string into actual hours and then calculate the difference between the two variables. const groupSchedule=[ {"days":"sat" ...

Oops, there seems to be a duplicate reference found for the provided id. Any suggestions on how to tackle this alert?

I've been working on a music app, and I've encountered an issue when navigating to the sound-playing page, leaving it, and immediately coming back. The error message that pops up is something I haven't been able to find any information on de ...

Spinning a sphere in such a way that the selected point is aligned as a Vector facing the camera

I have been searching for a solution to this particular issue and have come across two responses that are either outdated or do not provide the necessary THREE related code. question and question My desired outcome is to have the clicked point facing the ...

Adding elements to an array with the help of an event listener

I am facing an issue where I need to update an array with values once a user clicks on an element in the DOM. It seems like the elements are getting pushed into the array inside the anonymous function, but outside the function, the array remains empty. How ...

I'm curious as to why the for-of loop within the function isn't producing the anticipated results that the regular for loop is achieving

Why is the behavior of the for...of loop different from the traditional for loop within this function? It appears that the 'el' in the for...of loop does not behave the same as iterable[i] in the regular for loop? var uniqueInOrder = function(it ...

Stop or terminate all ongoing requests in AngularJS

When switching routes, I want to prevent any pending requests from the previous route in order to avoid issues where responses from the previous route interfere with data on the current route. This sometimes happens when responses from the previous route t ...

Utilizing a particular iteration of npm shrinkwrap for project dependencies

When deploying my node.js app to Appfog, I encountered a problem with their install script failing to parse npm-shrinkwrap.json. The current format of a dependency in shrinkwrap.json is as follows: "async": { "version": "0.2.10", "from": " ...

Safeguard your app's initialization by implementing a tidy method to guarantee only one instance of a

Ensuring a singleton service is created on application boot is crucial. Adding it as an injection parameter to the AppComponent without using it may seem unclean. Currently, I have implemented the following solution: import { APP_INITIALIZER, ModuleWithPro ...

Should commas be used in variables?

Could this be converted in a different way? $('#id').testfunction({ 'source' : [ {'source':'pathimage.jpg','title':'Title 1','description':'This is a description 1.'}, ...

Using jQuery Selectable with an Accordion Interface

Exploring the wonders of jQuery Accordion, I have been immersing myself in the examples shared on Mikes.Netting website, and delving into all the Selectable, etc. features showcased at jQuery-UI. Currently facing an issue where only child items in the fir ...

Obtain the mean value by selecting an input radio button

My goal is to calculate the average based on the selected radio button values. I have a form with 30 radio buttons, each ranging from 1 to 10. Now, I need to compute the average score and display it as a final result. While I managed to achieve this ...

Unlock the potential of AngularJS services with this innovative design strategy

I am currently developing an AngularJS client application that will communicate with a REST server. To handle the interaction between the client and server, I have decided to use the $resource abstraction from AngularJS. Each resource is being written as ...

JavaScript code to display elements upon button click

I've been working on creating some code that displays elements when a button is clicked. While I can make them appear, I'm having trouble getting each button to show its own set of elements separately (i.e., hiding other elements when a different ...

How can I trigger an event to append a UL element using

Can anyone suggest a more elegant solution for handling an append/remove event from an element without having to manually trigger an event or resorting to other methods? It would be great if there was a way to do something like this: $('#id').o ...

Experiencing a console error which reads: "SyntaxError: Missing ) after argument list."

While working on configuring a new React CSR app and incorporating some boilerplate libraries, I encountered an error in the console: Uncaught SyntaxError: missing ) after argument list (at @emotion_react_macro.js?v=30f6ea37:29894:134) I am hesitant to ma ...

Using jQuery to completely replace the DOM with new HTML content by utilizing the .load method

I'm currently facing an issue with a Captive Portal implementation on my website. Here's the scenario: go to any site, like www.php.net, and then in Chrome's console, execute the following code: $("html").load( "https://www.ccc.co.il/Suspe ...