I think I realised when the problem is coming.Only window.myobject.myfunc() is working fine since in the code currently I am registering to the window object "myObject" and to it I am adding "myFunc". BUT in the JS first I check if window.myObject is true, if so, I am calling window.myObject.myFunc. . This is somehow failing and giving me the error "Uncaught TypeError: undefined is not a function", source: https://xxx.com/app/homepage"
This is how the JS looks like.
Please see and tell me if you can get an idea why its failing. I have put alerts for testing purpose
- Code: Select all
<script>
function willHandleView() {
var canhandleview;
if(window.myObject) {
canhandleview = window.myObject.myFunc();
alert(canhandleview );
}
</script>
Please note that alert of window.myObject shows me "[object Object]".
Please help.