I started playing with windows desktop gadgets, which are essentially mini web pages. I'm building an ActiveX control using Delphi and importing this control into the HTML doc. Now I'm not too familiar with HTML/javascript, but very familiar with Delphi. I need to be able to interact with this ActiveX component from Javascript, and be able to trigger events in the component to execute event handlers in the javascript.
I have it declared like this:
for example, if I have my own property in this component called "MyNumber" then how would I read/write MyNumber from javascript?
I assume in the onload() event handler I will have to assign some event handler to an appropriate event, such as "OnMyNumberChanged". Or do I set this in the declaration of <object />?
JD Solutions
I have it declared like this:
Code:
<head>
<script type="text/jscript" language="jscript">
function init()
{
var oBackground = document.getElementById("imgBackground");
oBackground.src = "url(GadgetBackSmall.png)";
//Somehow set my component's event "OnMyNumberChanged" to function "MyNumberChanged"
//id of component is "JDNG"
}
function MyNumberChanged(Sender, Value)
{
//In Delphi...
//> Sender: TObject;
//> Value: Integer;
//Somehow write for example Width of component, or other properties
}
</script>
</head>
<body onload="init()">
<g:background id="imgBackground">
<object classid="clsid:E09288CA-7458-4CD8-AD50-2B8AE8D06019" id="JDNG"
style="position:relative;float:left;
width:100%;height:100%;left:10px;top:10px;border:none;">
</object>
</g:background>
</body>
for example, if I have my own property in this component called "MyNumber" then how would I read/write MyNumber from javascript?
I assume in the onload() event handler I will have to assign some event handler to an appropriate event, such as "OnMyNumberChanged". Or do I set this in the declaration of <object />?
JD Solutions