There is direct option to add the user control in the page and then the java script might work(Not sure). For doing that you have to register the UC in your aspx page with giving the attributes src, Tagprefix and tagName....It mat help you.
Otherwise Instead of calling the UC you write the code in a aspx file(Instead of .ascx extention) and the Load that file by using a literal control. It should work with that method.
Please mark as Answer if the post help you to get the answer.
Tapojjwal Mandal