I’ve got the following website http://rangeessentials.petersenuploads.co.uk/
The page uses a slightly modified responsive framework to load auxilliary content via AJAX when the screen width is above a certain size (480px). However, if you resize the screen to a narrow width and refresh and then make it wider, I get duplicate content loaded. I’m checking if content is loaded (look in init.js), but it seems to be ignored. I can’t figure out what’s going on. Any ideas?
Thanks
It is because
$.ajaxis asynch. Depending on how fast the server-side function isloadLeftAux()for example will fire mutiple times before thesuccessfunction has added the content and the class. The if statement won’t work until the first ajax call has returned it’s response and added the content. When the content is appended you’ve already started more ajax calls that will finish and add more content.What you have to do is that you have to determine if yo have an ajax-call running before you’re sending a new request.