Javascript keeps popping up an alert box stating 'out of memory line #'. How can I fix this? I have about 4 AJAX calls, 3 setIntervals, 4 window., and about 20 functions(). Please give me advice on how to fix this! Thanks. ~imozeb
It is alot of code so I wasn't sure if I should post it here, about 1000 lines (just for the javascript) split across three files (Different APIs). But mainly it consists of 4 AJAX calls, 3 setIntervals, 4 window.vars, and about 20 or so functions comlex functions and about 30 minor functions (5 or so lines each). I think it might be the setIntervals that are doing it because there are so many of them and on the last file when I took out the setInterval() it worked. If you think the setInterval() is the problem could you tell me and I'll post that API here so you can see it. Could you give me any hints on what to look for to delete? And are 4 AJAX calls on one page to many. Only one of them is called repeatedly. Thanks. ~imozeb
Well then post the setInterval which you commented out to make your script work and any function you call in that setIinterval. That should give us some more info and we can take a look at whats going wrong
Right. Here's the code. (Note: there are other function calling setInterval and AJAX scripts but they do not interact at all with this function) Javscript Code: //parse and output data function ratingoutput() { //check non existent buttons and items if (window.ratingstarcheck == null){ window.ratingstarcheck = document.getElementById("ratingstar5"); } if (window.ratingoutputcheck == null){ window.ratingoutputcheck = document.getElementById("ratingoutput"); } //output data if (xmlhttprating.readyState == 4 && window.ratingoutputcheck != null) { //parse data //print data document.getElementById('ratingoutput').innerHTML = xmlhttprating.responseText; } tr = setInterval(ratingoutput(), 2000); loopfunction() } //call rating output function xmlhttprating.open("POST","../../assets/API/API_Ratings/ratingsfunction.php",true); xmlhttprating.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttprating.setRequestHeader("Connection", "close"); xmlhttprating.send('do=routput'); ratingoutput() Code (markup): The code isn't finished yet cause of the error. But this is what I have now. Thanks. ~imozeb