TOPIC: Javascript not working

I have multiple surveys on my server and am experiencing an odd issue in just one survey. I have added the js source to the question text but when I preview the question group it doesn't run.

I have noticed that if I simplify the js to simply pop up an alert then it works. My customised code doesn't though. I have another survey on that server that is has an exact copy of the code except for the qid's and it works correctly.

Can someone please provide some insight as to how to debug to issue? or even better provide an explaination of why that is occuring and how to fix it?

Not sure if it helps but FYI

The issue is 2 date questions that follow each other - in date 1 i have a listener for a change and it updatess date 2 with 3 things - 1. clear the old date2 value, 2. set the max date to one year after date 1, set the min date to 1 day after date1

from Date of Issue(Non working code from actual survey - PLEASE NOTE THAT I TRIED TO MOVE THE DATE OF EXPIRY TO THE NEXT QUESTION GROUP AS A TEST BUT THAT DIDN'T WORK SO THAT CHANGE IS REFLECTED HERE AS WELL)
<script type="text/javascript" charset="utf-8">
$(document).ready(function () {
'use strict';