Using JScript to Interact with ActiveX Controls : JavaScript DHTML examples (example source code) » Development » ActiveX

JavaScript DHTML
C++
Java Products
Java Articles
JavaScript DHTML Home  »   Development   » [  ActiveX  ]   
 



Using JScript to Interact with ActiveX Controls

Please note that some example is only working under IE or Firefox.


/*
JavaScript Unleashed, Third Edition
by Richard Wagner and R. Allen Wyke 

ISBN: 067231763X
Publisher Sams CopyRight 2000

*/
<html>
<head>
  <title>JavaScript Unleashed</title>
  <script type="text/javascript">

  <!--
    function loadBox() {
      alert("The Great Question");
}
  //-->
  </script>
  <script type="text/javascript" for="CommandButton1" event="Click()">
  <!--
    var msg = "She loves me";
    var altMsg = "She loves me not";
    if(CommandButton1.Caption == msg){
      CommandButton1.Caption = altMsg;
      window.defaultStatus = altMsg;
    }else{
      if(CommandButton1.Caption == altMsg){
        CommandButton1.Caption = msg;
        window.defaultStatus = msg;
      }
    }
  //-->
  </script>
</head>
<body onload="loadBox()">
  <object id="CommandButton1" width="98" height="32"
    classid="CLSID:D7053240-CE69-11CD-A777-00DD01143C57">
    <param name="VariousPropertyBits" value="268435483">
    <param name="Caption" value="She loves me">
    <param name="Size" value="2096;678">
    <param name="FontCharSet" value="0">
    <param name="FontPitchAndFamily" value="2">
    <param name="ParagraphAlign" value="3">
    <param name="FontWeight"  value="0">
  </object>
</body>
</html>
Related examples in the same category
1.   Accessing ActiveX Controls
2.  Using ActiveX Components with JScript








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.