-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Exclude the 'javascript:;' from the next url #535
Comments
Do you have any examples? It sounds like something very specific and I'm not sure if I should bloat IAS to support every other lib out there, but if this is a common thing or used by large libs I can consider it. |
Hi fieg, You can check this example out: https://us.brinks.com/insights. See the next button at the bottom of the page when you go to the last page. The href of the next button becomes href="javascript:;" on the last page. We dont need to do library-specific logic. Just need to do an additional check to make sure the next button URL is valid before requesting it. I know there is no customer support for the paid customer but I did pay for the license. I think it will help others to have this feature. |
Thank you for your reply! I see you point and agree, which leads me to a few questions:
If you have thoughts on these questions, please share. |
We can check if the URL is a valid URL by using regex: https://stackoverflow.com/questions/1303872/trying-to-validate-url-using-javascript, or simply check if the URL starts with To get the absolute URL, we can use this: https://stackoverflow.com/questions/3943281/resolving-relative-urls-in-javascript
Once we got the absolute URL, we can check if the URL is valid or not. |
Thank you for your detailed reply 🙏 I will take it into consideration. If you are up for it, feel free to send in a PR with a code proposal. |
Description
Some of the pagination libraries put 'javascript:;' in the next URL when reached to the last page. Currently, the library throws an error:
Can we validate the next URL, if it is not a valid URL, consider it as a last page?
The text was updated successfully, but these errors were encountered: