Re: Trigger Update of ActiveX Control in Javascript?



suckerformimi wrote:
Our goal here is to offer the user a chance to upgrade without making
it mandatory. AFAIK the <object> tag doesn't give us enough control.
This is why we want to _trigger_ the upgrade in javascript.

Users can use a no-download version of our product. In this case, no
ActiveX warning bar shows up. There will be a panel offering the
download version.

Users of the download version will be offered optional updates. They
will be required to upgrade if they do anything that requires new
features.

It looks like the solution involves dynamically creating and deleting
objects. We need to be able to delete the plugin object, replace the
<object> tag, and then render new javascript that will trigger the
download of a new version.


Yes. you are on the right track. you can document.createElement an object
tag and add it dynamically.


Here's one I did recently:

<script>//><\'

r={

params:{

version: "1.0.1",
args: "blah args",
launchURL: location.href
},
attributes:{
id: "ro",
valign: "top",
classid: "clsid:9ddfb297-9ed8-421d-b2ac-372a0f36e6c5",
codebase: "http://www.rebol.com/plugin/rebolb5.cab#version=0,5,0,0"//,
wmode: "transparent"
},
style: "height:80%;width:100%;background-color:black;"
}

function insertObject( doc, object ){

var tag=doc.createElement( "object" );
var param;
for( var each in object.params ){
param = document.createElement("param");
param.name = each;
param.value = object.params[each];
tag.appendChild( param );
}
for( each in object.attributes ){
tag[each]=object.attributes[each];
}
if("style" in object){
if("string" == typeof object.style){
tag.style.cssText = object.style;
}
else if("undefined" != typeof object.style ){
if("object" == typeof object.style){
for( each in object.style ){
if( each == "length" ) continue;
tag.style[each] = object.style[each];
}
}
}
}
return document.body.insertBefore(tag, document.body.all(0));

}



.



Relevant Pages

  • Re: Trigger Update of ActiveX Control in Javascript?
    ... AFAIK the tag doesn't give us enough control. ... This is why we want to _trigger_ the upgrade in javascript. ... Users of the download version will be offered optional updates. ...
    (microsoft.public.scripting.jscript)
  • Re: Adding rows to a table, works in Firefox, but not IE
    ... mark-up and they will be implied, the opening tag by any TR ... It sounds like the sort of thing that might come form someone familiarwith Java who has not understood that javascript is not Java. ... What is an inner function declaration? ... your assignment to it is an assignment to a property of the ...
    (comp.lang.javascript)
  • Re: RFD: How To Recognize Bad Javascript Code
    ... Elements consist of tags ... Your example `script' elements are empty where they should have ... | Using the pseudo-protocol javascript in the href is never valid. ... Some web developers use this to work ...
    (comp.lang.javascript)
  • Re: check email address is real
    ... MVP FrontPage ... it doesn't understand the tag it ignores it and reads whatever's inside. ... I just wouldn't put money on the noscript tag distinguishing between users ... The idea is, spambots do NOT execute javascript, and therefore ...
    (microsoft.public.frontpage.programming)
  • Re: Best Practice - xp_cmdshell question
    ... If so, this would not> work, because users cannot be asked to wait for 1+ minutes before a tag> prints. ... >>> Why not have the trigger insert the data into a table and then have a>> scheduled job routinely poll the table for items to be printed. ... >> Andrew J. Kelly SQL MVP ... >>>> locks) wait on a batch file is really suicide. ...
    (microsoft.public.sqlserver.security)