BC99Chapter 38The (Cool web site) Navigator and Other Environment ObjectsWhen an
Friday, March 28th, 2008BC99Chapter 38The Navigator and Other Environment ObjectsWhen an object requires VBScriptNot all objects that load via the objectelement are scriptable through JavaScript (JScript). Occasionally, an object is designed so that its properties are exposed only to VBScript. Thishappens, for example, with the Microsoft Windows Media Rights Manager (DRM) object. Tofind out if the browser (operating system) is equipped with DRM, your page loads the objectvia the objectelement as usual; however, a separate VBScript section must access the objectto test for the existence of one of its properties. Because script segments written in either lan- guage can access each other, this isn t a problem provided you know what the property ormethod is for the object. The following fragment from the Head section of a document demon- strates how JavaScript and VBScript can interact so that JavaScript code can branch basedon the availability of DRM: