Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , ,

Sponsored Links



How to interaction VBScript and JScript in ASP page

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 06-03-2010
Member
 
Join Date: Feb 2010
Posts: 513
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.
Reply With Quote
  #2  
Old 06-03-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
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.
Reply With Quote
  #3  
Old 06-03-2010
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
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.
Reply With Quote
  #4  
Old 06-03-2010
absolute55's Avatar
Member
 
Join Date: Nov 2005
Posts: 1,238
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.
Reply With Quote
  #5  
Old 06-03-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
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)
Reply With Quote
  #6  
Old 06-03-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to interaction VBScript and JScript in ASP page"
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: Jscript completion Error Disha N Technology & Internet 5 17-02-2011 10:31 AM
How to add VBScript code in a page Aahlaadith Software Development 6 30-11-2010 12:38 AM
Problems Inserting a VBScript into HTML Page? Viensterrr Software Development 4 29-01-2010 04:58 PM
Image Maps and Browser Detection of JScript Juan-Carlos Software Development 5 18-12-2009 06:16 AM
Can't Register Jscript and VBscript error 0x80004005 minepassport Vista Help 2 05-07-2009 10:28 PM


All times are GMT +5.5. The time now is 03:49 AM.