Microsoft is used to write a Javascript plug-in, Script #

Source: Internet
Author: User
In the past, Javascript was written manually. Although there was no major problem, it was prone to errors. I have introduced a Microsoft internal Javascript Writing Tool, Script #. I just used it to introduce it. For details, I can view the help PDF file.
Download and install the SDK first. Take VS2005 as an example.
After installation, you can create a new website. Note that only the C # website is supported, and VB is not supported.
  

Generate a bunch of code and a Default. aspx page.
Page, there is a piece of code. 1 <Code>
2 using System; using ScriptFX; public class MyScriptlet {
3 public static void Main (ScriptletArguments arguments ){
4}
5}
6 </Code>

You can write the C # language here. I am too tired to write it here without any prompt. On the design page, right-click and select Edit C # Code.
  
Now, you can write code in a prompt range. When the code is run, Javascript is generated.
Example: 1 using System. DHTML;
2 using ScriptFX;
3 using ScriptFX. UI;
4
5 public class MyScriptlet
6 {
7
8 public static void Main (ScriptletArguments arguments)
9 {
10 MyScriptlet mys = new MyScriptlet ();
11 System. Callback cb = new System. Callback (mys. Execute );
12 windows. SetTimeout (cb, 1000 );
13}
14
15 public void Execute ()
16 {
17 string msg = "hello world ";
18 this. ShowMsg (msg );
19}
20
21 protected void ShowMsg (string msg)
22 {
23 Window. Document. Title = msg;
24}
25}

It is easy to see what the code is.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.