July 13, 201313 yr I'm currently developing an interactive part of my website and am have some real difficulty with my array. I currently have over 2000 questions, but have restricted the loop to just 50 at a time. xml.find("question").each(function(){ var q = $(this); number++; //console.log(q.contents().find("media").text()); var question = new Question({ question:q.contents().first().text(), image:q.find("media").text(), prefix: prefix, number: number, fixHeightListener: fixWrapperHeight, questionListener: questionListener, singlechoicehint: singlechoicehint, multiplechoicehint: multiplechoicehint, showHint: showHint }); question.createAnswers(q.children("answer")); questions.push(question); if(number == 50) return false }); //console.log("loaded"); // go( questionId); } // end success ajax }); // end ajax this is the section of code that i'm using, but I want to add a random function in to the loop. I've tried various ways, all of which have been unsuccessful can anyone help Thanks
Create an account or sign in to comment