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:
- Define the scriptlet using an object tag, setting its TYPE attribute to "text/x-scriptlet".
- 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:
- Create a scriptlet container object in your application and set its name property.
- Set the scriptlet container object's URL property to the URL of the scriptlet you want to use.
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.
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.
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.
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
댓글목록
등록된 댓글이 없습니다.