Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:47:11+00:00 2026-06-12T17:47:11+00:00

I have a jQuery ajax call wich fills a array; this array should be

  • 0

I have a jQuery ajax call wich fills a array; this array should be accesible in another function. It actually is in FireFox and Safari, but isn’t in IE.
IE says: SCRIPT5007 Unable to get the value of property ‘name’: object is null or undefined

It looks like it has a problem with ‘globalDataArray[i].name’ as well with ‘globalDataArray[i].objectid’. Both are perfectly assessed and used by FF and IE, so there not really empty. Anyone any thoughts on why this happens? I’ve googled a lot; the common problem of using comma’s or stuff at the end is not the solution.

Here the var is set:

var globalDataArray = [];
function retrieveContentData(content){


    $.ajax({
        url: 'http://services.arcgis.com/nSZVuSZjHpEZZbRo/ArcGIS/rest/services/NLCito/FeatureServer/0/query',
        data: {
            where: content,
            geometryType: 'esriGeometryEnvelope',
            spatialRel: 'esriSpatialRelIntersects',
            outFields: '*',
            returnGeometry: false,
            returnIdsOnly: false,
            returnCountOnly: false,
            f: 'pjson'
        },
        success: function(data){
            data = $.parseJSON(data);//Always parse JSON data
            var features = data.features;
            for (var i=0; i<features.length; i++) {
                //globalDataArray.push(features[i].attributes.NAME);
                //globalDataArray[features[i].attributes.OBJECTID] = features[i].attributes.NAME;
                globalDataArray[i] = {  "objectid": features[i].attributes.OBJECTID,
                                        "name": features[i].attributes.NAME,
                                        "type": features[i].attributes.Type
                                        };
            }
            shuffle(globalDataArray);//Shuffle the array items

            //Count total and set progress report
            $('#totalTasks').text(features.length);

            //Initialize the progress bar and create the first task
            updateProgressBar(0);
            createNewTask();

        }//End success
    });//End Ajax call

}//End function

And here is where I would like to use it again:

function validateAnswer(){
    //Prevent validating if task div not shown
    if($('#task').is(":visible")){

        var passedTask = false;

        var typedAnswer = $('#taskAnswerInput').val();

        var desiredAnswer       = globalDataArray[i].name;
        var desiredAnswerShort  = desiredAnswer.replace(/\(.*?\)/, "");//Remove eveything within and with bracklets
        desiredAnswerShort      = jQuery.trim(desiredAnswerShort);//Remove any whitespace on beginning and end of the string

        if(typedAnswer === desiredAnswer || typedAnswer === desiredAnswerShort){
            alert('Exact, helemaal goed!');
            $('#tasksRight').text(parseInt($('#tasksRight').text()) +1);
            passedTask = true;
            updateProgressBar(i);
        }else{
            alert('Jammer, dat is niet het goede antwoord');
        }

        if(passedTask == true){
            nextTask();
        }
    }//end if visible
}

End this is where the createNewTask() function is being called:

var i = 0;
function createNewTask(){
    //Since a new tasks is started, let's update the progress
    $('#tasksDone').text(i);

    //Highlight a single place
    executeQuery(globalDataArray[i].objectid);

    //Change tasks text
    var type = globalDataArray[i].type;
    if(type === 'Plaats'){ type = 'Welke plaats';}
    if(type === 'Gebied'){ type = 'Welk gebied';}
    if(type === 'Water'){ type = 'Welk water';}
    if(type === 'Provincie'){ type = 'Welke provincie';}
    $('#taskPointType').html(type);

    $('#taskAnswerInput').val('');//Clear the input field
}

function giveupTask(){
    var correctAnswer = globalDataArray[i].name;
    alert(correctAnswer);
    $('#tasksWrong').text(parseInt($('#tasksWrong').text()) +1);//Update currentWrong
    nextTask();
}

//Aparte functie, om validateAnswer() flexibeler te houden
function nextTask(){
    //fire new task
    i++;
    if(i < globalDataArray.length){
        //Update progressbar
        updateProgressBar(i+1);//+1 since i starts with 0
        createNewTask();
    }else{
        //All tasks done
        alert('Einde, alle plaatsen gehad');
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:47:12+00:00Added an answer on June 12, 2026 at 5:47 pm

    Solved it. For anyone interested:

    it looks like IE isn’t always giving back the right error’s, jquery ajax success, complete and error functions we’re helpful in fixing it.
    In the end it turned out that the problem was in the cross-domain ajax-call; IE is blocking them, unless you’re using dataType: jsonp. Just regular json isn’t good enough.

    Thanks for sharing you’re thoughts!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code inside the success function of a jQuery ajax call success:
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
A situation I ran across this week: we have a jQuery Ajax call that
I have a jquery json ajax call and inside my success function I have
I have a web service that returns this string via the jQuery $.ajax() call
On my main page I have this jquery code which does an ajax call
I have a jQuery AJAX function like this: $.ajax({ url: 'crud/clients.php', dataType: 'json', type:
I have the following jQuery ajax call setup: function Testing() { var result =
I have a jquery Ajax call function that I use to submit form to
I have a jQuery AJAX call that creates and displays a form like this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.