Mixing server-side vbscript and javascript? 
Author Message
 Mixing server-side vbscript and javascript?

Hi,

Is it possible for an ASP page to have its server-side script written in
both vbscript and javascript?

The reason I ask is that I have an application written in server-side
Javascript.  The guy who wrote it has left the company, and I need to amend
it.  Rather than rewrite it all in vbscript, I'm wondering if it is possible
to remove some of the javascript routines in a page and replace them with
vbscript, with which I am familiar.

Thanks,

Daren   dpearcy[at]hotmail[dot]com



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?
Yes, it's possible. Just change the language name on the <script> tag, but
it's not a good programming because the both language engines are loaded to
the server and they require more memory.

LS


Quote:
> Hi,

> Is it possible for an ASP page to have its server-side script written in
> both vbscript and javascript?

> The reason I ask is that I have an application written in server-side
> Javascript.  The guy who wrote it has left the company, and I need to
amend
> it.  Rather than rewrite it all in vbscript, I'm wondering if it is
possible
> to remove some of the javascript routines in a page and replace them with
> vbscript, with which I am familiar.

> Thanks,

> Daren   dpearcy[at]hotmail[dot]com



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?

I've heard it said that you can mix server side scripting languages, but
that you take a big performance hit.  
On the other hand, it seems that I got an error message when I didn't have

you'd tell the server you had switched.  If you experiment I'd be curious
to find out what worked or didnt.

You should probably bite the bullet and go with one or the other.



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?
the asp module must be in one language or the other.  you need to specify
which language
at the top of the module.

bryan



Quote:
> Hi,

> Is it possible for an ASP page to have its server-side script written in
> both vbscript and javascript?

> The reason I ask is that I have an application written in server-side
> Javascript.  The guy who wrote it has left the company, and I need to
amend
> it.  Rather than rewrite it all in vbscript, I'm wondering if it is
possible
> to remove some of the javascript routines in a page and replace them with
> vbscript, with which I am familiar.

> Thanks,

> Daren   dpearcy[at]hotmail[dot]com



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?

Quote:

>Is it possible for an ASP page to have its server-side script written in
>both vbscript and javascript?

>The reason I ask is that I have an application written in server-side
>Javascript.  The guy who wrote it has left the company, and I need to amend
>it.  Rather than rewrite it all in vbscript, I'm wondering if it is possible
>to remove some of the javascript routines in a page and replace them with
>vbscript, with which I am familiar.

You can mix languages, but you have to be careful about
execution order.  I write pages mixing VBScript and Perlscript
on occassion, and the Perlscript sections are executed first
regardless of the order of the scripts on the page.  This is
counter-intuitive (at least for me) for a scripting format, and
can cause hard debugging until you realize what's happening.
Whether you use <script> tags or <% %> for the default language
can also affect execution order.

Someone posted the rules and reasons a while back in a
discussion on this topic.  I don't recall the specifics, so check
the archives.

mdc

--------------------------
http://www.mc2studios.com/



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?

You can mix the two togeter.

Here's a simple sample with everything mixed together:

<%If request.querystring("ShowFieldValue")="Yes" Then%>
    <SCRIPT LANGUAGE="JavaScript">
        alert("The Field is
<%=server.URLEncode(Request.Querystring("FieldValue"))%>")
    </SCRIPT>
<%ELSE%>
    <SCRIPT LANGUAGE="JavaScript">
        top.window.location="Gohere.asp"
    </SCRIPT>
<%End IF%>

David

Quote:

>Hi,

>Is it possible for an ASP page to have its server-side script written in
>both vbscript and javascript?

>The reason I ask is that I have an application written in server-side
>Javascript.  The guy who wrote it has left the company, and I need to amend
>it.  Rather than rewrite it all in vbscript, I'm wondering if it is
possible
>to remove some of the javascript routines in a page and replace them with
>vbscript, with which I am familiar.

>Thanks,

>Daren   dpearcy[at]hotmail[dot]com



Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?
On Thu, 14 Sep 2000 09:15:39 -0500, "Bryan Bullard"

Quote:

>the asp module must be in one language or the other.  you need to specify
>which language
>at the top of the module.

Possibly true but misleading.  A "module" is not necessarily an entire
page.  You can have blocks of code in different languages in the same
ASP file, processed as a single page.

mdc

Quote:



>> Hi,

>> Is it possible for an ASP page to have its server-side script written in
>> both vbscript and javascript?

>> The reason I ask is that I have an application written in server-side
>> Javascript.  The guy who wrote it has left the company, and I need to
>amend
>> it.  Rather than rewrite it all in vbscript, I'm wondering if it is
>possible
>> to remove some of the javascript routines in a page and replace them with
>> vbscript, with which I am familiar.

>> Thanks,

>> Daren   dpearcy[at]hotmail[dot]com

--------------------------
http://www.mc2studios.com/


Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?


Quote:

>You can mix the two togeter.

>Here's a simple sample with everything mixed together:

><%If request.querystring("ShowFieldValue")="Yes" Then%>
>    <SCRIPT LANGUAGE="JavaScript">
>        alert("The Field is
><%=server.URLEncode(Request.Querystring("FieldValue"))%>")
>    </SCRIPT>
><%ELSE%>
>    <SCRIPT LANGUAGE="JavaScript">
>        top.window.location="Gohere.asp"
>    </SCRIPT>
><%End IF%>

This isn't really mixing code.  This is a VBScript ASP page
that outputs client-side Javascript code.  I think what the
original poster was asking about is mixing two different
ASP languages like:

<SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
  # Perlscript code here
</SCRIPT>

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
  ' VBScript code here
</SCRIPT>

Your example really isn't "mixed code" because one set runs
on the server and the other set runs on the client.  As far as
the VBScript is concerned, the Javascript is just text content.
As far as the Javascript is concerned, the VBScript doesn't
exist.

mdc

Quote:

>>Hi,

>>Is it possible for an ASP page to have its server-side script written in
>>both vbscript and javascript?

>>The reason I ask is that I have an application written in server-side
>>Javascript.  The guy who wrote it has left the company, and I need to amend
>>it.  Rather than rewrite it all in vbscript, I'm wondering if it is
>possible
>>to remove some of the javascript routines in a page and replace them with
>>vbscript, with which I am familiar.

>>Thanks,

>>Daren   dpearcy[at]hotmail[dot]com

--------------------------
http://www.mc2studios.com/


Wed, 18 Jun 1902 08:00:00 GMT  
 Mixing server-side vbscript and javascript?
Thanks mdc, that's what I meant.

Daren

Quote:

> <SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
>   # Perlscript code here
> </SCRIPT>

> <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
>   ' VBScript code here
> </SCRIPT>



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Passing Data from Server-side vbscript to Client Side Javascript

2. pass server side vbscript to client side javascript

3. How to mix [ServerSide] VBScript and JavaScript in same .ASP file.

4. Server side and Client side mix

5. Problem Using server side VBScript with JavaScript

6. Calling Server-side VBScript Function When JavaScript Is Default ASP Language

7. VBScript Error message when using server side javascript

8. Javascript/VBscript mixing with ASP for forms...

9. How2 mix Client Side JavaScript w/ASP ?

10. mixing javascript and VBScript

11. Dropdown fields and mixing Javascript and VBScript

12. Problem mixing javascript and vbscript


 
Powered by phpBB® Forum Software