Help with vbscript

This forum is for all Flare issues not related to any of the other categories.
Post Reply
pouliotmax
Sr. Propeller Head
Posts: 122
Joined: Wed Mar 07, 2007 9:16 am
Location: Quebec City

Help with vbscript

Post by pouliotmax »

Hi,

i'm trying to include a simple vbscript in Flare. I'm trying to include the followin code :

Code: Select all

<%
response.write("<h1>Hello World!</h1>")
%>
in the Insert/Script window

But Hello World is not showing...

How come?
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Help with vbscript

Post by RamonS »

What is the output format? My assumption is that whatever displays the output does not know what to do with this code. As far as I know there is no help viewer or browser that executes VBScript.
pouliotmax
Sr. Propeller Head
Posts: 122
Joined: Wed Mar 07, 2007 9:16 am
Location: Quebec City

Re: Help with vbscript

Post by pouliotmax »

So it won't work with html 5?
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Help with vbscript

Post by RamonS »

I severely doubt it. I am not aware that browsers generally are capable of executing VBScript. Apparently, older IE versions have that option and IE11 can be made to execute VBScript (see http://stackoverflow.com/questions/1748 ... xplorer-11), but that will flop in other browsers. I suggest that any client side scripting you need is done using JavaScript. Overall, I recommend server side scripting if at all possible because it is not dependent on client processing power and servers scale better than clients.
kwag_myers
Propellus Maximus
Posts: 810
Joined: Wed Jul 25, 2012 11:36 am
Location: Ann Arbor, MI

Re: Help with vbscript

Post by kwag_myers »

Where I you attempting to add the script? You can put something like this inside the body tag:

Code: Select all

		<FORM NAME="Form1">
			<INPUT TYPE="Button" NAME="Button1" VALUE="Click" />
				<SCRIPT FOR="Button1" EVENT="onClick" LANGUAGE="VBScript">
					MsgBox "Hello World!"
				</SCRIPT>
		</FORM>
or put the script inside the head

Code: Select all

    <head>
		<SCRIPT FOR="Button1" EVENT="onClick" LANGUAGE="VBScript">
			MsgBox "Hello World!"
		</SCRIPT>
    </head>
    <body>
			<INPUT TYPE="Button" NAME="Button1" VALUE="Click" />
    </body>
But, as RamonS says, it only works with more recent versions of IE, and only after allowing ActiveX Controls. I tested FF and Chrome unsuccessfully. The issue is that VBScripts present a security risk and current browsers don't allow it. If you have a rather large VBScript, you may look into an online converter and go with JS.
"I'm tryin' to think, but nothin' happens!" - Curly Joe Howard
Post Reply