Let's take a look at some JSNI examples.
我们来看一些例子。
Our JSNI version of Hello world is shown in Listing 5.
Helloworld的jsni版如清单5所示。
You can implement a client-side method completely using JSNI.
单纯用JSNI 就能实现客户端方法。
Loading album data using Ajax: JSNI to manipulate XForms data.
使用Ajax载入唱片数据:用jsni操作x Forms数据。
Take a look at Listing 7 to see how an improved version of our JSNI "Hello world."
清单7是“Helloworld”的改进版本。
JSNI can be considered the Web equivalent of inline assembly code. You can use it to.
JSNI可以视为内联汇编代码的web对等物,可以用来。
Listing 6 shows the needed JSNI code. I won't go into all the details here, but note.
清单6给出了所需的JSNI代码。
In the previous article, you saw that you can use GWT and JSNI to create XForms controls.
上一期文章提到,可以使用GWT和JSNI创建X Forms控件。
Let's take things a step further and use GWT and JSNI to dynamically create XForms controls.
我们再前进一步,看看如何使用GWT和JSNI动态创建X Forms控件。
Your JSNI code will create your controls and then invoke a remote service to retrieve album data.
JSNI代码将创建控件,然后调用远程服务检索唱片信息了。
When you access the browser's window and document objects from JSNI, you must reference them as $wnd and $doc, respectively.
当从JSNI访问浏览器窗口和文档对象时,必须将其分别作为 $wnd 和 $doc 加以引用。
You've defined some new controls for your data entry form, but you can once again make use of GWT and JSNI to create these new controls.
现在为数据输入表单定义了一些新控件,同样可用GWT和jsni来创建。
This will allow you to simplify your page, and you'll simplify it even more by using GWT JSNI to dynamically create your XForms controls.
这样可以简化页面,如果使用GWTJSNI动态创建X Forms控件甚至还能进一步简化页面。
Finally, you went even further down the JSNI road by using it to dynamically create all of our XForms controls used for showing the album data.
最后,沿着JSNI的路线更进一步,利用它动态创建显示唱片数据所需要的全部XForms控件。
The GWT development documentation warns that JSNI must be used with discretion because browser portability isn't guaranteed, and the compiled code optimization is restrictive.
GWT开发文档提示说必须慎重使用JSNI,因为不能保证浏览器的可移植性,而且编译代码的优化是有限制的。
The GWT development documentation warns that JSNI must be used with discretion because browser portability isn't guaranteed, and the compiled code optimization is restrictive.
GWT开发文档提示说必须慎重使用JSNI,因为不能保证浏览器的可移植性,而且编译代码的优化是有限制的。
应用推荐