Code not working in Chrome & maybe IE

I have this code
// show_summ_ls250.php
$fname = "summaries/" . $_SESSION['vid'] . "summary.pdf";
<!DOCTYPE html>

<title>Show LS250</title>
function go_ls250() {
	str = "<? print $fname; ?>";;
	window.location = "projectsn.php";	
<body onLoad="go_ls250()";>


Open in new window

For me, this code works as I expect in both Firefox & Chrome. Bit sure about ie, or whatever it's called

In both cases, it opens a new window & shows the pdf file in the window. The user can review, download, etc.

Fir my customer, it works in FireFox if popups are allowed. It does NOT work in chrome; he says it shows the pdf for an instant, then disappears.

I do not want to be dependent of browser settings on client computer.

How can I make this work as desired REGARDLESS of browser?
Richard KortsAsked:
Who is Participating?
Dave BaldwinFixer of ProblemsCommented:
That should work as long as they have to click on it to use it.  I use a link on this page to open or download a PDF.
Richard KortsAuthor Commented:
I just tried it in MS Edge, it does NOT show the window with the pdf displayed.

Dave BaldwinFixer of ProblemsCommented:
You can Not reliably make that work.  Any 'automatic' pop-up will normally be blocked by the browsers pop-up blocker.  Only pop-up that are a result of a user action like clicking on a link on the page are allowed.
Richard KortsAuthor Commented:

So if I put a link the page that goes to that place (like target="_blank"), that will work?


Richard KortsAuthor Commented:
Works perfect, thanks Date.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.