-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(in a userscript for reddit.com) It only appends page 2 when having login #58
Comments
@darkred - The element you call Based on looking at your site's code, I think what you want is something like this: $('#siteTable').jscroll({
nextSelector: 'span.nextprev a',
contentSelector: '.thing'
}); I don't know what your ajax response looks like exactly, but if it is just like the original page content, then you will want your next page content to be filtered by inserting only the Please let me know if this helps! |
@darkred - Also, make sure you are not linking to javascript from raw.github.com, as the headers will not be sent correctly and break the script in some browsers - see this post on stackoverflow: http://stackoverflow.com/questions/7180099/including-js-from-raw-github-com Instead, I suggest you use something like https://rawgit.com/ or maintain the script on your server itself. |
Thank you very much for the detailed and instructive replies! I just tried your code and it only appends page 2. Unfortunately I'm unable to make the script work. |
@darkred - Ok, I see the reason for both issues. As for the pagination, once you go to the second page, Secondly, the "recently viewed links" section also uses the $('#siteTable').jscroll({
nextSelector: 'span.nextprev a:last',
contentSelector: '#siteTable .thing'
}); |
I tried it and, yes, the "recently viewed links" section is no longer appended. |
Ah.. sorry, you also need to include $('#siteTable').jscroll({
nextSelector: 'span.nextprev a:last',
contentSelector: '#siteTable .thing, .nav-buttons'
}); I just tried this out on http://reddit.com and it works. |
Now it works great!! Thanks a lot for all your help and for making this! |
@darkred - You may also want to add a callback: function() {
$('.nav-buttons').remove();
} |
Thanks! Now it's perfect! |
I've made this userscript in order to use jScroll it in reddit.com and any subreddit
where
span.nextprev
is the selector for the Next buttonand
div.content
is the selector for the links content of every next page.If open eg. reddit.com without login, then it works ok (it appends every next page).
The problem is when I try my userscript having login:
it only appends page 2, not the next pages
(it just shows Loading... at the end of the appended page 2 )
for example in:
Is my userscript wrong or it'is jScroll?
The text was updated successfully, but these errors were encountered: