inherit
191686
0
Jul 30, 2024 4:10:58 GMT -8
garrus
25
March 2013
garrus
|
Post by garrus on Sept 12, 2014 18:51:00 GMT -8
Hey,
I'm looking for a way to detect when the pagination buttons are clicked by using javascript.
I've found this code for example that detects when a normal link is pressed:
$(document).on("click", "a", function() { //this == the link that was clicked var href = $(this).attr("href"); alert("You're trying to go to " + href); });
But this doesn't fire on the pagination buttons. I assume because they're queries on the current URL rather than moving to a different URL? I'm not very skilled in web development so I'm no doubt misunderstanding something.
Thanks for your help.
ps: the purpose behind it is that I have something that loads when the page is loaded/refreshed (which is expected) but I also want it to happen when the page of a thread changes.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 12, 2014 19:07:34 GMT -8
The Proboards API defines some events one could use to hook their code into the process and listen then react when such events occur. pb.events.on('pageChage', function(){ //DO SOMETHING })
|
|
inherit
191686
0
Jul 30, 2024 4:10:58 GMT -8
garrus
25
March 2013
garrus
|
Post by garrus on Sept 12, 2014 19:11:13 GMT -8
Ah thanks! I was actually trying something similar to that code I found from another plugin's source, but other code I'd tried earlier was preventing it from happening for some reason. All working now, thanks!
|
|