I'm currently using fullCalendar.js as part of my web application.
When a calendar date is clicked, a window pops up, allowing the user to enter details about calendar events, and to save them.
I want to be able to trigger a function in the calendar object from the opened window.
Does Javascript have the facility to address objects from separate windows?
I have tried many ways of accessing the fullCalendar() object from a different window, but none has worked.
stuff like
$(window.opener.document.body).find('#calendar').fullCalendar('refetchEvents');
Specifically I'm targeting the refetchEvents hook.
Nothing like this, or any variant on it has worked so far.... there are many ways of addressing the object, but none that can reference an 'instance' within a separate document.
What's going on here?
Is it impossible to reference my calendar object from a separate window?
Really appreciate the pointers.
Edit ------------------
I've just tried:
console.log(window.opener.calendar.fullCalendar())
this produces a promising result, it's found the function, unfortunately now all of its internal references are messed up.
Uncaught TypeError: Cannot read property 'eventSources' of undefined
m.fn.fullCalendar:8888/js/fullcalendar/fullcalendar.min.js:110
$.ajax.successhlc.js:892
f.Callbacks.ojquery-1.7.2.min.js:2
f.Callbacks.p.fireWithjquery-1.7.2.min.js:2
wjquery-1.7.2.min.js:4
f.support.ajax.f.ajaxTransport.send.d
Apart from that, no change so far. Implementing a new function now.
Still dealing with global var calendar
console.log(window.opener.calendar.fullCalendar.bind(window.opener.calendar)());