Vb script does not work in Chrome or Firefox - only in Internet Explorer

I wrote VBScript in my project, but this only works with IE, not chrome / firefox. I need a VBScript library for my code. How this code will work on chrome and firefox. My code

<SCRIPT LANGUAGE="VBScript">
     Sub clickHandler()
         sP = Window.Event.SrcElement.ID
         If Left(sP, 1) = "M" Then
             Set oC = Document.All("C" & Mid(sP, 2))
             If oC.Style.Display = "none" Then
                 oC.Style.Display = ""
             Else
                 oC.Style.Display = "none"
             End If
             Set oC = Nothing
         End If
     End Sub
</SCRIPT>
+4
source share
2 answers

VBScript client code only works with IE.

Chrome and Firefox, more standards compliant, expect Javascript client code

It looks like your click handler is hiding / showing something. This is pretty easy to achieve in Javascript with jQuery, for example, this should hide the "elementid" on click:

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
$(document).ready(function(){
  $('#elementid').click(function(){
    $(this).hide();
  });
});
</script>
+15
source

VBScript Internet Explorer

+3

Source: https://habr.com/ru/post/1540323/


All Articles