I am so confused as to why i am getting duplicate images coming through as a result.
here is the code i have on jsfiddle:
i was thinking maybe it is an async problem, receiving the new pagination before it searches however, what can i do to change that???
thank you
Aiden
The problem is that the second
$.ajax()call is made before the first one ended.What you need to do is set a function like this:
where
nis used only to check the number of times you call the function andpagesis the number of pages you want to “load/show”.Then you just have to call this function once with the url you have like this:
and you should get what you want.
Here is a DEMO.