Im trying to bebug some javascript in firefox and I keep getting this error.
SyntaxError: syntax error
data: {action: addtocart, id: <br />
the javascript is this:
<script type="text/javascript">
jQuery(document).ready(function($){
$('#button').on('click', function(e){
$.ajax({
url: 'shopping2/includes/functions.php',
type: 'POST',
data: {action: addtocart, id: <?php echo $pid; ?> },
cache: false,
success: function(data){
alert(data);
}
});
});
});
</script>
where is the error?