简体   繁体   中英

Sending a message from c++ to javascript

is there an example in which a message from c++ sent like dom->sendMessage("something") , is used inside a javascript?

thank you, daniele

The html-overlay example is what you're looking for. Here is a more detailed answer about how to get those messages in JavaScript.

Note that the Minko AbstractDOMElement implementation "should" give you all the DOM methods you need to interact with any DOM element directly in C++ without JS. Including (but not limited to):

Using those methods your C++ code can easily "change" the HTML5 UI components just as you would in pure JS (since it's the same DOM API).

Now if you want some JS code to be "notified", your JS code can:

  • listen to the actual correspoding DOM events;
  • listen to a custom message you'll have to send from the C++ code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM