Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MyControl::ReceiveMessage(msg)
- {
- alert(msg);
- }
- var GetControl = document.getElementById("MyControl");
- function GetControl::ReceiveMessage(msg)
- {
- alert(msg);
- }
- <script for="MyControl" event="ReceiveMessage(msg)">
- alert(msg);
- </script>
- var clock = new ActiveXObject("Clocks.clock");
- var extendedClockEvents = clock.ExtendedClockEvents();
- // Here you assign (subscribe to) your callback method!
- extendedClockEvents.ScriptCallbackObject = clock_Callback;
- ...
- function clock_Callback(time)
- {
- document.getElementById("text_tag").innerHTML = time;
- }
- function onEventHandler(arg1, arg2){
- // do something
- }
- window.onload = function(){
- var yourActiveXObject = document.getElementById('YourObjectTagID');
- if(typeof(yourActiveXObject) === 'undefined' || yourActiveXObject === null){
- alert('Unable to load ActiveX');
- return;
- }
- // attach events
- var status = yourActiveXObject.attachEvent('EventName', onEventHandler);
- }
- function MyControl::ReceiveMessage(msg)
- {
- alert(msg);
- }
Add Comment
Please, Sign In to add comment