Results 1 to 6 of 6

Thread: How to interaction VBScript and JScript in ASP page

  1. #1
    Join Date
    Feb 2010
    Posts
    537

    How to interaction VBScript and JScript in ASP page

    Hi all,

    I am using ASP for web development in my new project. The need to use scripting language used by the current rewrite those scripts? Or, is it possible to call in a scripting language built-in functions other scripting languages? I want to know how to make the ASP applications, VBScript and JScript scripting scripts interact in order to maximize access to the characteristics of the two scripting languages support. check and reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    How to interaction VBScript and JScript in ASP page

    In the VBScript and JScript, there are a large number of built-in function is the same or similar. However, in a scripting language built-in functions are not always in another scripting language also has the corresponding function. For example, VBScript provides a number of strings and formatting of data for the operation of the functions that does not exist in the JScript. These functions include StrReverse (), Filter (), as well as FormatCurrency () and so on. On the other hand, JScript provides for the management of an array, the string functions in VBScript code, etc. is also not defined, such as join (), reverse (), pow (), bit manipulation, escape () and unescape () and so on. check and reply.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    How to interaction VBScript and JScript in ASP page

    If you need to call a VBScript script JScript built-in functions, you should write a VBScript user defined function, and then call the utility as the JScript script like JScript function calls the user-defined functions. For example, if you want to call VBSCript built-in function is FormatCurrency (), you can state the following custom function:
    Code:
    <SCRIPT LANGUAGE = "VBSCRIPT" RUNAT = "SERVER">
    Function FormatValue (Value)
    FormatValue = FormatCurrency (Value)
    End Function
    </ SCRIPT>
    Then in the JScript code can be the same as ordinary JScript function calls FormatValue () has. A similar approach can also be used to achieve VBScript code calls the JScript function. Apply the same rules, we can call in any script in any user-defined function. However, from within the JScript script that calls a VBScript procedure with no parameters (Sub) should be slightly pay attention, this time in the JScript should be like calling a JScript function with no arguments, like call it, such as the use foo () call to VBScript Sub foo process.

  4. #4
    Join Date
    Nov 2005
    Posts
    1,323

    How to interaction VBScript and JScript in ASP page

    In some cases, mixed-use VBScript and JScript function is very useful, but in different languages to share data between the script may also be useful. To achieve this shared approach is simple: no matter what language is used, as long as the page-level variable declarations can be an arbitrary reference. Using methods similar to the object, you can arbitrarily choose the appropriate language to read, modify attributes or invoke an object method. Of course, the given object's properties and methods to create the object instance is defined by the language. As the previous example VBScript procedure call, when calling from the JScript in a VBScript object with no parameters, the method, its invoke method calls to comply with the rules JScript and vice versa. Check and reply.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to interaction VBScript and JScript in ASP page

    VBScript reference from the JScript array is more complex. Although in VBScript, we can directly access the JScript array of related methods and properties, but there is no direct access to the JScript array of individual elements. In other words, we can read VBScript script JScript array length property, as follows:
    x = myJSArray.length
    But you can not directly read the individual elements of the array, the following VBScript code is not correct:
    x = myJSArray (3)

  6. #6
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to interaction VBScript and JScript in ASP page

    Within an ASP project with the flexibility to choose different scripting language has many advantages, these scripts even more interactivity between the developers integrate different languages provided by the built-in functions and other functions has brought more opportunities, but also makes the realization of VBScript can also be used for general-purpose scripting library JScript environment possible. Check and reply.

Similar Threads

  1. Internet Explorer 8: Jscript completion Error
    By Disha N in forum Technology & Internet
    Replies: 5
    Last Post: 17-02-2011, 10:31 AM
  2. Microsoft JScript compilation pop up error in Internet explorer 8
    By Jigya L. in forum Technology & Internet
    Replies: 3
    Last Post: 11-02-2011, 11:56 AM
  3. How to add VBScript code in a page
    By Aahlaadith in forum Software Development
    Replies: 6
    Last Post: 30-11-2010, 12:38 AM
  4. Problems Inserting a VBScript into HTML Page?
    By Viensterrr in forum Software Development
    Replies: 4
    Last Post: 29-01-2010, 04:58 PM
  5. Image Maps and Browser Detection of JScript
    By Juan-Carlos in forum Software Development
    Replies: 5
    Last Post: 18-12-2009, 06:16 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,934,718.49880 seconds with 16 queries