• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing Variable w/Javascript and VBScript

 
Kevin Brennan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a code snippet on the web that uses VBscript embeddedin a Javascript to check for the presence of a plugin. Conditioned on passing a check for IE on a Windows platform, the following function is called:

detectIE("PDF.PdfCtrl.5","Acrobat Reader").

Code for the function:




I added some extra statements for debugging. The short story here is that the value for "result" is always false -- in other words, even if the IsObject function is true (meaning that the ActiveCObect exists), the Javascript never gets it. You can see this by observing that "result2" is always false even though it is changed within the VBScript.

Would this ever work? Is there a way to get Javascript to recognize a variable modified by VBScript?

Thanks to all who take the time to read this post.
[ August 12, 2005: Message edited by: Kevin Brennan ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can't share variables between VBS and JS. What you could do is provide a hidden field that's part of a form, and write a value into it using VBS, which can then be read by JS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic