Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
blocks:api:javascript [2023-04-18 16:14] – Complete adminblocks:api:javascript [2025-10-01 13:22] (current) – [Additional Web Block Interaction Capabilities (postMessage)] mattias
Line 134: Line 134:
 </code> </code>
  
-==== Additional Web Block Interaction Capabilities ====+==== Additional Web Block Interaction Capabilities (postMessage) ====
  
 Custom code hosted inside a Web Block has some additional capabilities for talking to the enclosing Spot. Those are made available through the the browser's //window.parent.postMessage// function, passing various messages and parameters out of the IFRAME hosting the Web Block, then handled by the main Spot code. Custom code hosted inside a Web Block has some additional capabilities for talking to the enclosing Spot. Those are made available through the the browser's //window.parent.postMessage// function, passing various messages and parameters out of the IFRAME hosting the Web Block, then handled by the main Spot code.
Line 213: Line 213:
 </code> </code>
  
-Replace <nameOrIp> with the IP number or resolvable name to your Blocks server. If you're using HTTPS to access your Blockss server, specify "wss:" as the protocol instead of "ws:". If you're running on a non-standard port, append the port number separated by a colon. Hence, if your Blocks server rus on 10.1.0.10 using the standard port, the call would look like this:+Replace <nameOrIp> with the IP number or resolvable name to your Blocks server. If you're using HTTPS to access your Blocks server, specify "wss:" as the protocol instead of "ws:". If you're running on a non-standard port, append the port number separated by a colon. Hence, if your Blocks server runs on 10.1.0.10 using the standard port, the call would look like this:
  
 <code> <code>