Skip to content

Conversation

@merutak
Copy link

@merutak merutak commented Jul 18, 2015

Let client use AJAX (e.g. POST) instead of just HTML loading. This can be useful:

  1. Let the server know how the previous page worked out (e.g. how much conversion, how long the user spent on it, etc.)
  2. Items are returned in non-HTML (e.g. JSON; especially the link to the next page) and need deserialization before jscroll gets to process them.

This is done by hooking options.loadFunc and providing an arbitrary asynchronous loading function there.

Of course load() is still the default.

@danielson317
Copy link

+1 for this feature.

@jevanlingen
Copy link
Contributor

The way you wrote it won't work, as the this scope is gone in your callback function. So change

target.load(data.nextHref, function (r, status) { callback(status); });

to

target.load(data.nextHref, function (r, status) { $.proxy(callback, target)(status); });

N.B.
I don't have push access to your branch, so I am writing this as a comment instead of fixing your PR.

@jevanlingen
Copy link
Contributor

@pklauzinski; Any change this PR will be merged?

@pklauzinski pklauzinski self-assigned this Oct 6, 2016
@gcrispyn
Copy link

gcrispyn commented Jul 3, 2017

+1 for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants