How can I open a new tab using javascript or jquery and insert new dynamic content in it? Bypassing the pop-up issue also, as I need to show a .pdf file in new window, but you can show me the code of opening and showing HTML in it, I will handle the pdf part.
Thanks
I have done similar work in the past, you need to do two steps in it.
In this way you will be able to bypass pop-up message of browser also, so your code can be
//remember this button click should be by user, otherwise, you will get pop-up
$('.button').click(function (e) {
//open new blank tab
authWindow = window.open('about:blank', '_blank');
//place your html/pdf url in it
authWindow.location.replace('/pdfview/111/view'); // here '/pdfview/111/view' is url to fetch data for window
});
Please, do remember , the above button click should be by user otherwise you will get browser pop-up message
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly