One of the PHP-generated calls is as follows:
<script>
var copyrecipient = [];
var customhintcopy = [];
copyrecipient.push('customer');
copyrecipient.push('healthinsurance');
customhintcopy.push('4');
customhintcopy.push('6');
$.ajax({
type: "POST",
url: "./content/pdf-view-bill.php",
data: {
bills: '6',
copyrecipient:copyrecipient,
customhintcopy:customhintcopy,
additionaltextcopy: '',
copycoveringnotes: '5',
documentationcopy: '1',
original: '1'
},
success: function(data){
var win = window.open();
win.document.write(data);
}
});
</script>
An error message "Uncaught SyntaxError: Unexpected identifier" appears in the console on the "success-line," and I'm unsure why. I am looking to open a new tab or window that receives the defined data above. Can anyone assist me with this? I am relatively new to Ajax...