Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Solution: Open a link in a new tab from a page loaded on Ajax.

    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.

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close