Hi,
if I run a paged loop with javascript links inside, those links works only on the first page.
My script:
$(".my-class").click(function(){
window.location = $(this).attr("data-href");
return false;
});
Hi,
if I run a paged loop with javascript links inside, those links works only on the first page.
My script:
$(".my-class").click(function(){
window.location = $(this).attr("data-href");
return false;
});
Sorry, my bad.
I forgot to set the proper scope on the function and to pass the object in ma call.
So I close the issue.
Working code with call from onclick
<div class="my-class" data-href="https://www.google.com" onclick="myFunction.call(this)" >
and following myFunction()
function myFunction() {
window.location = $(this).attr("data-href");
return false;
};
window.myFunction = myFunction;
Glad you were able to find a solution! I’m not sure of the exact scope of these issues, but I know there are some limitations in the current implementation of pagination that can break things beyond the first page of a paginated loop. We’re in the process of reworking L&L’s approach to pagination to solve those kinds of issues and make pagination a lot more flexible. Sounds like that might not have been plaguing you in this case but I figured I’d at least let you know that there are some solid improvements to pagination in the pipeline.