Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2004, 03:15 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mixing JavaScript and VBScript in ASP

Hi,

  is it possible to use both JavaScript functions and VBScript functions inside the same webpage?

Can I call VBScript functions/subs from JavaScript functions?

If so - how? Do I have specified the languages at the <Script> tag
level but am unable to get the 2 types of functions to work
together.

Any help appreciated.
Cheers.
Chas.


 
Old September 10th, 2004, 04:19 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Yes it is possible to use both JavaScript functions and VBScript functions inside the same webpage . And you can call vbscript from javascript
Like this example

<SCRIPT language="JavaScript1.2">
<!--
    if (top.location != document.location) top.location = document.location ;

function ak_help()
    {
        top.window.open("a.htm","")
        //clos()
    }



    </script>
    <script language="VBScript">

    alert("Hi")
    ak_help()

    </script>


Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
 
Old September 10th, 2004, 09:34 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I know that for some cross language client scripting functionality, one language has to preceed the other. If you have global variables, they need to be define in one language first, then you can use in the second. But if you reverse the language order (and more the declaration to the other language) it will fail. Unfortunately I don't remember which language needs to go first but something deep in my cranial recesses tells me it's VBScript first.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixing PHP and Javascript nmjnmj Pro PHP 4 December 9th, 2006 01:31 AM
JavaScript to VBScript Thomas82 Classic ASP Basics 1 July 29th, 2006 07:03 PM
vbscript and javascript together erin VBScript 1 October 21st, 2003 02:48 PM
Using VBScript and JavaScript together jwalborn Classic ASP Professional 2 October 13th, 2003 10:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.