Best way to call a javascript function like 'window.open()' in Smart Mobile Studio

129 Views Asked by At

I'm evaluating SMS and really enjoying the experience. I need to open a new window/tab on the browser using window.open(). I have got this working using an asm block but I can't help but feel that there is a better way which I don't know about. So, is there a more SMS way of doing the following?

  asm
    window.open('MyPDF.pdf');
  end;

Many thanks. Regards, Will.

1

There are 1 best solutions below

0
gabr On BEST ANSWER

Traditionally that was the only way, but in recent Smart releases you can also use the BrowserAPI entry point.

uses SmartCL.System;

BrowserAPI.Window.open('MyPDF.pdf');