Adding Scriptlets to Your Application > html

본문 바로가기
사이트 내 전체검색

html

Adding Scriptlets to Your Application

페이지 정보

작성자 서방님 댓글 0건 조회 121회 작성일 06-09-14 11:28

본문

You can use scriptlets as you would any control.

To add a scriptlet to a Web page:

  1. Define the scriptlet using an object tag, setting its TYPE attribute to "text/x-scriptlet".
  2. Specify the scriptlet's URL by setting the DATA attribute in the object tag, as in the following example.
    
    

    Or, specify a URL using the object's param tag, as in the following example:

    
    
    Note  If you insert a scriptlet into a Web page using a visual tool such as a toolbox or control insertion dialog box, the resulting object definition might include a CLASSID attribute instead of the TYPE attribute.

To add a scriptlet to a host application:

  1. Create a scriptlet container object in your application and set its name property.
  2. Set the scriptlet container object's URL property to the URL of the scriptlet you want to use.
Important  If you are adding the scriptlet to a Web page, do not set the URL property to the URL of the current page. Doing so causes a recursive call to the page and causes the browser to stop functioning.

You can add scroll bars if the scriptlet is too small to be displayed within the container object. For details, see scrollbar.

You can also resize the container object from within the scriptlet by using a script to set the Dynamic HTML (DHTML) script object's pixelHeight and pixelWidth properties. The following example shows how to resize the scriptlet container when the scriptlet is first loaded.


If you change the .htm file after creating the control, the display in the control is not updated until the next time the page is read. This occurs when the application is run or if you change the URL property of the control again.

Note  After the scriptlet is initialized, the F5 key, which is used to refresh a page in Microsoft® Internet Explorer, is not active in the scriptlet container object.

After creating an instance of the scriptlet, you can write scripts for it as you would for any other control. The object you are using to work with properties and methods is the scriptlet container object; the exact properties and methods you can use are defined by the scriptlet identified in the container's URL property.

Note  If you are working in an environment that can display an object's properties and methods, such as Microsoft Visual Basic®, you will not see the properties, because they are not exposed to the development environment.

For example, the following code, in a Visual Basic form, sets a property and calls a method in the page referenced by the ScriptContainer1 control.


Note  In Visual Basic, you must pass a parameter to a scriptlet method, even if the method does not require one, because errors can occur. For example, the following statement passes a placeholder parameter of zero to a scriptlet method that does not require parameters.

Before getting a scriptlet's properties or calling its methods, be sure that the scriptlet has been fully loaded. For details, see the container object's onreadystatechange event and readyState property, and the scriptlet's frozen property.

Handling events that occur in the scriptlet is slightly different than it is for events in other objects. For details, see Defining Event Handlers.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarscript/html/adding.asp

댓글목록

등록된 댓글이 없습니다.

Total 323건 20 페이지
게시물 검색

회원로그인

접속자집계

오늘
123
어제
225
최대
1,347
전체
154,882
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.