I have faced a problem many times that “_blank” doesn’t work sometimes to open a link new tab and at that time I always run for the solution.
I have also faced a problem when I was trying to open a link in a new tab while the content was loading dynamically through the AJAX request for a particular part of a complete page. The link was not opening on the new page.
So here I got the solution for this
Here javascript:void(0) prevents the page to open a link on the same page and it even stops the page from reloading on clicking on the link.
if we use only window.open(‘link’, ‘_blank’); the page will open in the new tab but the current page will reload at the same time, which is not good in practice.
In case you have any queries then feel free to ask in the comment section below.
Be the first to comment.