Scripting Client-Side Chilkat ActiveX Components in Javascript
This page provides information about how to get started using a Chilkat ActiveX in Javascript. The HTML below shows how to embed a specific Chilkat ActiveX in an HTML page and uses it in client-side Javascript. The steps for embedding any Chilkat ActiveX in HTML and scripting it in Javascript are as follows:
- Insert an OBJECT tag to create an instance of the ActiveX within the HTML DOM. The URL to use for codebase will depend on the ActiveX to be embedded. The classid is also specific to the component. You should provide a "name" to make it easy to reference the object within your Javascript. The components are non-visual, so the width and height can be 0.
- If the component has an UnlockComponent method, it should be called first. The Chilkat ActiveX components are effectively freeware when running client-side within a browser. The reason is that there is no way to hide a permanent (purchased) unlock code. Chilkat does not wish to introduce any licensing infrastructure, so we have decided to make the ActiveX components browser-aware. When running within a browser, the fully-functional trial period never expires. Therefore, any string can be passed to UnlockComponent and it will always unlock.
- Once the component is unlocked, the properties may be get/set, and the methods may be called.
- It is possible to dynamically create an instance of the ActiveX using Javascript's ActiveXObject function.
<object name="crypt2" width=0 height=0
classid="clsid:3352B5B9-82E8-4FFD-9EB1-1A3E60056904"
standby="Loading Chilkat Crypt2..."
type="application/x-oleobject"
codebase="http://www.chilkatsoft.com/download/ChilkatCrypt2.cab">
</object>
<p id="something">This text will get updated by Javascript.</p>
<script type="text/javascript" language="javascript">
var p = document.getElementById("something");
document.crypt2.UnlockComponent("Anything can go here.");
p.innerHTML = "Chilkat Crypt2 Version = " + document.crypt2.Version;
// Objects may be dynamically created using Javascript's "new ActiveXObject":
var obj2 = new ActiveXObject("ChilkatCrypt2.ChilkatCrypt2");
alert(obj2.Version);
</script>
Chilkat ActiveX in Javascript Reference - Shows the classid strings, codebase URLs, and ActiveXObject strings for each Chilkat component.
|
Privacy
Statement. Copyright 2000-2008 Chilkat
Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com Components for Microsoft Windows XP, 2000, 2003 Server, Vista, and Windows 95/98/NT4.
|

Downloads
.NET 2.0
.NET 1.*
.NET x64
VC++ 6.0
VC++ 7.0
VC++ 8.0
Java
Ruby
Perl 5.8.*
Perl 5.10.*
Python
Bounce ActiveX
Charset ActiveX
Email ActiveX
FTP2 ActiveX
Crypt ActiveX
HTML-to-XML ActiveX
HTTP ActiveX
IMAP ActiveX
MHT ActiveX
MIME ActiveX
RSA ActiveX
Socket ActiveX
Spider ActiveX (free)
String ActiveX (free)
Tar ActiveX
Upload ActiveX (free)
XML ActiveX (free)
XMP ActiveX
Zip ActiveX
|