Forum Moderators: open

Message Too Old, No Replies

OnClick problems with VBScript in Firefox

         

Ernie Simuro

11:34 am on Oct 14, 2007 (gmt 0)

10+ Year Member



I apologize if this has been asked before; I am attempting to use an OnClick event to fire a VBScript and am having trouble. I have simplified the script to the following and it still doesn’t work If I use JavaScript it works as expected however as the reminder of the script is in VBScript I would like this to work that way as well. Do anyone know a workaround to allow Firefox to run VBScript from an OnClick event.

</head>
<Script language="javascript"
<!--
function PrintButtonPressed()
{
alert("I am here!");
}

// -->
</script>
<body>

<INPUT type="button" value="Click To Print VB" language="VBScript" OnClick="msgbox('I am here ') ">

<input type="button1" value="Click To Print JS" OnClick="PrintButtonPressed();">

</body>

encyclo

1:09 pm on Oct 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld Ernie_Simuro!

The answer is simple - Firefox does not support either VBScript or ActiveX, which are both proprietary, Microsoft-only technologies.

So Javascript is the only possibility for cross-browser compatibility.

[mozilla.org...]

Note that there is a plugin for adding such compatibility, but the overwhelming majority of users will not have it installed, and I don't believe it is still maintained (there is no available version for Firefox 2.x).

lavazza

7:13 pm on Oct 14, 2007 (gmt 0)

10+ Year Member



Yep, what encyclo said re VBS being proprietary to Micro$oft

Plus...

There are a couple of errors in the way you have wriiten your sample code above:

  1. There should be NOTHING between </head> and </body>

  2. <Script language="javascript" is wrong;

    :( <Script language="javascript"

    :) <script type="text/javascript">

    (note the > at the end of the line too


<script type="text/javascript">
<!--
function PrintButtonPressed()
{
alert('I am here!');
}

// -->
</script>
</head>
<body>