I’m creating a pos billing system in laravel, I send request by ajax to router controller, and i want to in ajax response, he redirect another page with some data for display in invoice.
My function work properly , in my browser network section, in preview have display invoice , but I want to this invoice open in another page .
my ajax code
billPrint function in controller
I’m trying to my invoice page open in another page , currently invoice page open in response .
2
Answers
In order to open the invoice in another page you do not need to use ajax.
Simply opening a new browser tab from javascript, and setting the tab’s source to your controller would be fine:
(Insert the above code snippet in place of the ajax call in the index.blade.php)
Your billPrint controller already worked fine and you were able to see it the network preview tab because your controller responded with the rendered view and the preview tab displayed that response.