Reputation: 409
I setup a local site but when I goto it I get this error Uncaught SyntaxError: Unexpected token <
which brings me to this line of code:
<script type="text/javascript">
pepsiMedia.loadConfig(<?= json_encode($this->config) ?>);
$(document).ready(pepsiMedia.ready);
</script>
I am assuming it has something to do with the json_encode or my PHP version, what can I do to fix this?
I am bit hesitant about showing what $this->config is as it has sensitive information, let me know if you need it and I will try to recreate it without sensitive information.
Upvotes: 0
Views: 558
Reputation: 12295
Try with this:
<script type="text/javascript">
pepsiMedia.loadConfig(<?php echo json_encode($this->config); ?>);
$(document).ready(pepsiMedia.ready);
</script>
Upvotes: 1