postmessage

postMessage() alternative for ie6/7 between iFrames and/or pop ups

时光毁灭记忆、已成空白 提交于 2019-12-08 08:10:04
问题 I am attempting to create a login button for web application which either loads an iFrame or a pop up window. Similar to that of Facebook login button. Im currently using the postMessage() method which works a treat. However I know that it wont work in IE6/IE7 which I need to support. Is their any alternatives I could possibly use? or am I hoping for to much from the "awesome browser" that is IE6? 回答1: Back in the day, I used to write IE6-based websites that opened popups and communicated

PostMessage in service applications

主宰稳场 提交于 2019-12-08 05:30:01
问题 There is a problem I am unable to solve. I created two service applications in Delphi and tried to post messages within them. Of course, there are no windows in such applications and PostMessage needs a window handle parameter to send a message. Therefore, I created a window handle using the AllocateHWnd(MyMethod: TWndMethod) function and passed, as the 'MyMethod' parameter, a procedure I want to be called when a message is received. If it was a windowed application, PostMessage() called

Postmessage LParam truncation

天大地大妈咪最大 提交于 2019-12-08 04:09:32
问题 My app has a worker thread, and I use PostMessage to send a string to the main thread. For 1 message, the string is truncated when it gets to the message handler in the main thread. The string is constructed in the worker thread from a string of raw data that is like this. It ends at the last '20'. '01010000000030000102000008850008855343414E204544474520000000000000000000' Decoded into the string I want to send it looks like this, which is correct: '0100 0.50000 LSB0288.588.5SCAN EDGE ' The

How to send keydown event to inactive window in C++?

只愿长相守 提交于 2019-12-08 03:26:25
问题 [C++] How to send keydown event to inactive window? TAB key works fine. But I'm having trouble with other keys such as "Z". Been googling this for a while but haven't found a solution so far. Virtual key 0x5A should be the correct for letter Z. #include <iostream> #include <Windows.h> #include <string> LPCSTR Target_window_Name = "Untitled - Notepad"; //<- Has to match window name HWND hWindowHandle = FindWindow(NULL,Target_window_Name); int main() { //send TAB DOWN - WORKS FINE SendMessage

How do I use postMessage() in Javascript?

余生长醉 提交于 2019-12-07 20:39:50
问题 Is it possible to use the postMessage() method in Javascript to do cross-domain POST , GET , PUT , etc. calls? If so, how? And how do I pass headers and data? 回答1: This is a two way implementation, meaning that the page you want to call needs to have a callback that listens to such a message and give an appropriate response. You can't simply use it as a swap replacement for AJAX. The best method for that is to use a server-side proxy. See this page for an explanation of how postMessage works.

how to call window onunload event for iFrame button click where parent page and iFrame resides in different domain

那年仲夏 提交于 2019-12-07 12:28:42
问题 I have button which opens an iFrame (which reside in domain say 'xyz') the iFrame loads the page which resides in another domain (say 'lmn') $("#templateSelectionFrame").get(0).contentWindow.location.href = url; url is from another domain (I communicate in different domain with Jquery 'POSTMESSAGE') when user clicks cancel button from iFrame i need to close the iFrame but before that it is necessary to show the page leaving message (ie. stay on page / leave page - this is alreday called on

Creating a custom message/event with Qt

偶尔善良 提交于 2019-12-07 10:01:44
问题 I have an RPC thread that is calling back to me from that thread. I need to somehow inform Qt that it needs to make a function call from the main thread. In straight Windows I could do this by using a custom message and then posting that message to the message queue, e.g., I could create a WM_CALLFUNCTION message and pass the function pointer through wParam and the parameter (class pointer) through lParam . Has anyone an idea how I could do this with Qt? I've come across QCustomEvent but I

postMessage() generates error “undefined is not a function”

戏子无情 提交于 2019-12-07 07:21:24
问题 I'm trying to get postMessage() to work to communicate between an iframe and my main website. However using the exact syntax given in the example code on MDN, I am being presented with a nice Undefined is not a function error. I've tried several things, such as initializing the iframe inside Javascript and appending it to my page, but that left me with the same error. Same for have seperate selectors to select my iframe. I have the following Javascript code: <script type="text/javascript"> $

Async/Await answer onMessage event in cross-domain communication with an iframe

浪子不回头ぞ 提交于 2019-12-07 05:25:46
问题 I have an iframe, which is communicating with its parent window to set and get some essential cookies via postMessage method. At first a function in the iframe application requests Cookie A from the parent window. function requestCommunication(topic, customerId) { function cookieAvailable() { return new Promise((resolve) => resolve(getCookieData('cookieName')); }); } console.log(cookieAvailable()); if(!!cookieAvailable()) { //doStuff } } cookieAvailable() triggers the message from the iframe

postMessage() alternative for ie6/7 between iFrames and/or pop ups

◇◆丶佛笑我妖孽 提交于 2019-12-06 15:29:41
I am attempting to create a login button for web application which either loads an iFrame or a pop up window. Similar to that of Facebook login button. Im currently using the postMessage() method which works a treat. However I know that it wont work in IE6/IE7 which I need to support. Is their any alternatives I could possibly use? or am I hoping for to much from the "awesome browser" that is IE6? Back in the day, I used to write IE6-based websites that opened popups and communicated between the popup and the original window. So it can be done. The browser provides a few objects you can use