Reputation: 3163
I was wondering why my script file wasn't functioning here's my code:
$l2 = "<script>";
$l2 = $l2."window.open('http://sampleurl.dev/purchase_order/";
$l2 = $l2.$id;
$l2 = $l2."/pdf')</script>";
echo $l2;
return Redirect::action('SuppliersController@show',$supplierId);
but if I put die();
before the redirect the script is then functioning but I cant proceed to redirect anymore.
by the way I'm echoing $l2 to open a new window for my pdf view.
your help would really be appreciated!
Upvotes: 0
Views: 57
Reputation: 700422
You can't send both a content page and a redirect page in the same response. When you send the redirect, it will scrap any content that you have created for the page.
You can make a redirect in the client script:
echo "<script>window.open('http://sampleurl.dev/purchase_order/".$id."/pdf');window.location.href='somepage';</script>";
Upvotes: 1