I wrote VBScript in my project, but this is only working on IE and not chrome/firefox. I need a VBScript library for my code. How will this code work on chrome and firefox. My code is
<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>
VBScript is supported just by Microsoft's Internet Explorer while other browsers (Firefox and Chrome) support just JavaScript.
Right-click the VBS file that you cannot run and click "Properties." Click the "Change" button and double-click "Microsoft Windows Based Script Host" to restore the association. If you cannot find this item, click "Browse" and go to the "System32" folder inside your "Windows" folder in your primary drive.
Only IE 10 and older supports VBScript.
Client-side VBScript code only works on IE.
Chrome and Firefox, being more standards compliant, expect Javascript client-side code
It looks like your click handler is hiding/displaying something. This is quite easily achievable in Javascript with JQuery, eg this should hide 'elementid' when it is clicked:
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
$(document).ready(function(){
$('#elementid').click(function(){
$(this).hide();
});
});
</script>
VBScript only works in Internet Explorer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With