I am working on a sharepoint online team site collection. and i have a discussion board list. now inside the
AllItems.aspx view, i added the following script:-
the purpose of the script is that whenever a user clicks on a discussion board item, the item should open in a new tab instead of opening it on the current tab. this will ease reading multiple items. and i had to define my script inside a counter otherwise the script will not work. seems the 3 seconds can ensure that the page is fully loaded. Now the script might not be the best thing to do !! but at-least it worked well, even when i embed the allitems view inside my modern page, the script worked.
But the only issue i am facing is that if the users do a paging on the items, or click on the load icon, or click on one of the tabs (such as "my discussions" or "what's hot") as follow:-
then the items' links will not open in new tabs.. so my question is how i can force my script to run after doing paging or partial updates??