Read the statement by Michael Teeuw here.
Notification from iFrame? (MMM-Glance and ...?)
-
I have a web page with some button elements. The web page is shown via MMM-iFrameReload. How can I generate a notification from that web page? I would like to use MMM-Glance to temporarily hide another module.
-
@mmmmh far as I know, the page in the iframe does not KNOW its in a frame, vs being in a web browser someplace else… and is boxed in a container that it cannot communicate thru (this would be a HUGE security exposure to let a framed page get to outside the frame)
-
@sdetweil Thanks for the feedback. I thought so. I guess I’ll cook something up with MMM-Remote-Control.
-
OK, for posterity, here’s what I did.
I used MMM-Remote-Control and created a button element that calls a function that issues a get request. Interestingly, when I put the URL in the button code the request was rejected (no cross-origin request allowed) but when after I put the URL in the function it worked.
function toggleCal() { var myUrl = "http://mypi.local:8080/remote?action=TOGGLE&module=MMM-CalendarExt"; console.log("getting " + myUrl) var xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", myUrl, false); // false for synchronous request xmlHttp.send(null); return xmlHttp.responseText; };The button code gets mangled here. I had to add spaces
< button onclick="toggleCal()">Calender on/off< /button>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login