$.ajax call not working in Firefox, but works fine in Chome, Edge and CLIQZ

0

I’ll begin by saying I’ve checked all the related questions, and none of them appear to be directly relevant to the issue I’m having.

I have the following Javascript:

$(document).ready(function() {
    var admin = "<div id='admin'><h2>The administrator of this category is "
    admin += $('#admin-name').text()
    admin += "</h2><img src="
    admin += $('#admin-picture').text()
    admin += "><br></div><br><br>"
    $('.continent-expand-text:last-of-type').append(admin);

    var ngos = []
    $('.ngo-name').each(function() {
        ngos.push($(this).text());
    })
    var ngo;
    for (ngo in ngos) {
        var wikiRequestURL = ("https://en.wikipedia.org/w/api.php?format=json&formatversion=2&action=query&prop=extracts&exintro=&explaintext=&titles=" + ngos[ngo]+ "&callback=wikiCallback");
        $.ajax({url: wikiRequestURL, dataType: 'jsonp'}).done(function(response) {
            ngoName = response.query.pages[0].title
            var ngoID = '#' + ngoName.replace(/ /g, '-');
            $(ngoID).append(response.query.pages[0].extract);
        });
    };
});

The part dealing with admin shouldn’t have any bearing on this issue. Which is that the ajax call that’s dealt with in the rest of the code works perfectly on Chrome, Edge and CLIQZ, but fails without a trace on Firefox. The relevant fields don’t get updated with the requested info, but looking in dev tools there’s no sign of any error messages or anything else awry that I can discern.

Here’s the URL of an affected page on the website: http://ec2-34-207-99-196.compute-1.amazonaws.com/Human%20Rights/2/ngos/

I’d be very grateful if anyone could point me in the direction of fixing this.

Link: $.ajax call not working in Firefox, but works fine in Chome, Edge and CLIQZ
Source: Stack Jquery

Share.

About Author

Leave A Reply