[SOLVED] Call Client JavaScript methods from a Wisej Page loaded as iFrame in a standard html page.

Answered
0
0

Good morning to all. I need to call Javascript methods from a Wisej page loaded as an iFrame inside a standard html page, for example post a message to the window.parent page.

I tried to use the JavaScript.Call method but seem to be limited in scope to the current window and not to the window.parent when the Wisej page is loaded as iFrame source.

For sure i can implement something like SignalR to enable communication between object inside the page but for my goal this solution is to complex. My requirement it is only the access to the parent window.

Any help?

Thanks in advance.

Gabriele Del Giovine.

 

 

 

  • You must to post comments
Best Answer
0
0

Hi Gabriele,

 

The JavaScript component is an extender that adds the javascript and javascriptsource property and javascript events to controls.

The Call method is meant to call a specific function without worrying about the arguments. Wisej will serialize any argument including object maps.

The Eval method can call anything.

For a generic non-component specific invocation you can use Application.Eval(). No need to create the JavaScript component.

And of course there are also the async/await methods and callback variants.

  • You must to post comments
0
0

Some news:

 

 JavaScript x = new JavaScript();
//not work
 x.Call(“window.parent.postMessage”,”MESSAGE”,”*”);
//work
x.Eval(“window.parent.postMessage(‘MESSAGE’, ‘*’)”);
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.